Suppose the bear class looked like this:
Code:
class Bear()
{
int age;
int height;
char name[12];
//...
};
Suppose the age is 0x0000000D, height is 0x000000C8 and name is "Teddy". A bear object in memory is a bunch of bytes whose values might look like this: 0, 0, 0, 0x0D, 0, 0, 0, 0xC8, 'T', 'e', 'd', 'd', 'y', '\0', + 6 more bytes of garbage at the end of the name string. When you reinterpret-cast the bear object to a char pointer, this is how it will appear.
The catch is, that if the object was more complicated and for example used a std::string for the name member, this cast would do no good: a std::string would just contain pointer(s) but storing the pointer addresses in a file won't let you reconstruct the string that the pointers pointed to.