Maybe, I am misunderstanding smth.
I used this code 
 [StructLayout(LayoutKind.Sequential)]
        public unsafe struct Chararray
        {
            private double* recordedText;

            //an initializer to get and set the char* since it is unsafe
            public double* RecordedText
            {
                get
                {
                    return recordedText;
                }
                set
                {
                    recordedText = value;
                }
            }

            public override string ToString()
            {
                string s = "";
                //the HDF5 STRING is not a string but in fact a char *
                //since it is we need to translate the return into a
pointeraddress

                IntPtr ipp = (IntPtr)this.recordedText;
                //This call is used to transform the pointer into the
valueof the pointer.

                //NOTE:  this only works with null-terminated strings.
                s
=System.Runtime.InteropServices.Marshal.PtrToStringAnsi(ipp);

                return s;
            }
        }
-------------
and  added  <CharArray>  instead of <char> 

now the returning value of "CharArray" (is "0x000007ce "        double*)





--
View this message in context: 
http://hdf-forum.184993.n3.nabble.com/c-read-different-datatypes-tp4026057p4026061.html
Sent from the hdf-forum mailing list archive at Nabble.com.

_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to