Okay right , i am used to work with 8&16 bit embedded where a byte
is just an unsigned char.
So i should copy each item i think ?
Another question ..
In C for writing a structure to a file i used a cast
fwrite((void * ) &mystruct,sizeof(mystruct),1,myfilehandle);
how do i write a struct to disk in c#
Jon Skeet said:
if i have a variable decllared as :
char[] mychararray = new char[50];
and i have some method that needs an byte[] how do i cast or
convert this ?
Well, how do you want to convert each char to a byte? A char is a 16
bit value, and a byte is an 8 bit value - what do you want to do with
the "spare" 8 bits for each element?
(byte[]) mychararray does not work
No - because it's *not* a byte array.