Writting structure & array in file

jdy0803

Member
Joined
May 20, 2013
Messages
17
Programming Experience
10+
I have a structure and array.
I want to write in a file in C#.
Here is the C code.
How do I do in C#?


C#:
fp = fopen (filename, "wb");
if (! fp)
{
   return -1;
}
fwrite (&bfh.bfType, 1, sizeof(BITMAPFILEHEADER), fp);
fwrite (&bih.biSize, 1, sizeof(BITMAPINFOHEADER), fp);
fwrite (imagearray, 1, dwBitmapByteCount, fp);
fclose (fp);
I already declared BITMAPFILEHEADER and BITMAPINFOHEADER.
imagearray is BYTE *
 
Top Bottom