View Single Post
Old Jul 13th, 2007, 2:13 PM   #4
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
1) You're getting the errors (the only ones you mention in your post) because the pointer returned by new is not a valid pointer for free. Again, use delete.

2) Yup. The problem with writing the structure out en masse is that padding bytes may or may not be present with different compilers run on different systems. It's a portability issue.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote