Marshaling and Unmarshaling the data in C++