Typecast cross-platform compatibility
- by kaykun
Hi, what I'm trying to do is append a binary integer into a string object. So far I have this:
int number = 5;
cppstring.append((char*)&number, 4);
It works fine on a x86 system with Windows, but some people are saying its not cross-platform and is unsafe. What is the preferred method to do this?