I want to send a string through a socket.
So, i convert string into array of bytes.

System::String ^st = "ÿÿÿÿdetails\x00";
array<Byte>^ msg = Encoding::ASCII->GetBytes(st);

And when i convert back the array bytes to a string , i get a different string.

System::String ^t = Encoding::ASCII->GetString(msg);
MessageBox::Show(t,"asd");

The string t is "????details". Can some one please help me . I want to know how to convert the string into array of bytes . Thank You

Quick, before the mods get here! Add the code tags !

Quick, before the mods get here! Add the code tags !

Its not really worth the effort :)

It could be byte order problem.

anyone? help please ! :(

anyone? help please ! :(

sorry, I haven't done managed code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.