By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,635 Members | 2,227 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,635 IT Pros & Developers. It's quick & easy.

Reading data from a file

P: n/a
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
Feb 9 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
See there
http://groups.google.com/group/micro...014e3083fe9cd0
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:

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?


---
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

Feb 9 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.