E
Eric
Tell me why the following doesn't work...
void MyClass::StoreCommand( struct command cmdToStore )
{
memcpy( (char*)&theCommand,
(char*)&cmdToStore,
sizeof( struct command ) );
}
theCommand is also a struct command type.
This just makes a byte-by-byte copy of the origin (cmdToStore) to the
destination (theCommand), yet the destination ends up all corrupted
and bearing no resemblance to the origin.
void MyClass::StoreCommand( struct command cmdToStore )
{
memcpy( (char*)&theCommand,
(char*)&cmdToStore,
sizeof( struct command ) );
}
theCommand is also a struct command type.
This just makes a byte-by-byte copy of the origin (cmdToStore) to the
destination (theCommand), yet the destination ends up all corrupted
and bearing no resemblance to the origin.