Use throws, of course :-) The function should look something like this:
void Dump( const void * mem, unsigned int n ) {
const char * p = reinterpret_cast< const char *>( mem );
for ( unsigned int i = 0; i < n; i++ ) {
std::cout << hex << int(p[i]) << " ";
}
std::cout << std::endl;
}
Then used:
Foo * f = GetSharedFoo();
Dump( f, somesize );
where somesize is what you want to dump.
anon
source
share