Groups | Blog | Home
all groups > c# > february 2006 >

c# : Reading data from a file


Roob
2/8/2006 10:17:39 PM
I am learning C# and was wandering if there is a straightforward way to read
a binary file created by C++. For example, I have a data structure as
follows:

typedef struct _data
time_t date;
int seq;
char name[20];
short bday;
BOOL bIsWorking;
};

My first question is for just reading data back into a C# data structure,
will I need to create a struct using the same techniques for passing data to
unmanaged code (Runtime.Interop.Services)?
Second, how could I read this in using a data structure, is that possible?

Thanks for any help, I'll keep plugging a way at it any way!

Reuben

Michael Nemtsev
2/9/2006 1:35:28 AM
See there
http://groups.google.com/group/microsoft.public.dotnet.general/tree/browse_frm/thread/3872fe1fa0edf06c/8b500661f25b5c10?rnum=1&q=dotnet+read+c%2B%2B+structure&_done=%2Fgroup%2Fmicrosoft.public.dotnet.general%2Fbrowse_frm%2Fthread%2F3872fe1fa0edf06c%2F8b500661f25b5c10%3Ftvc%3D1%26q%3Ddotnet+read+c%2B%2B+structure%26#doc_65014e3083fe9cd0

[quoted text, click to view]

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
AddThis Social Bookmark Button