Posted by DarkTerritory on August 09, 1999 at 22:35:03:
In Reply to: read/write nodes posted by MtBiker on August 09, 1999 at 22:20:10:
: but that won't work now. So, I changed
: char *data to
: char data[255]
: this should let sizeof(Node) evaluate to the same thing
: for every node then right?
sizeof(Node) is always the same. Period. It does not change at runtime. If you use the array, then sizeof(Node) will be 251 bytes larger than if you used char*. This is because char* is just a 4-byte pointer.
If you find yourself seeming to read or write junk, make sure you opening the file as binary. I only say this because I made this mistake [g].
-DT