~mindsharing~ (C# snippets, Parse some lod files)
#6

In C++ its even more cool, u can read a struct from a file without having to read the members seperate

The problem with streaming a c++ struct to a file/network/database is that it only works on fix size struct but on dynamic size structs will not work correctly(you would need to create a method to stream each members)

this struct will work 2 bytes to id and 12 to name
struct data{
int id;
char name[12];
};
//this struct will not work 2 bytes to id and 4 bytes is the pointer address in memory.
struct data{
int id;
char* name;
}



Messages In This Thread
[No subject] - by ILAn12346 - 05-25-2012, 04:14 AM
[No subject] - by Wizatek - 05-25-2012, 06:43 PM
[No subject] - by ILAn12346 - 05-25-2012, 09:24 PM
[No subject] - by Wizatek - 05-25-2012, 09:48 PM
[No subject] - by ILAn12346 - 05-25-2012, 10:03 PM
[No subject] - by someone - 05-26-2012, 01:07 PM
[No subject] - by Wizatek - 05-26-2012, 02:38 PM
[No subject] - by Reza - 05-31-2012, 05:41 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)