Joke Collection Website - Blessing messages - How to realize getbytes in java with c++, or how to convert a string into its byte array in c++.

How to realize getbytes in java with c++, or how to convert a string into its byte array in c++.

C++ use Strcpy to stop.

in p>java, if you insist on assigning a value instead of assigning a reference, that is, if you don't want to modify one of them and the other becomes the same, you should use class.clone (), and then assign the new reference of clone to another String.

in short, string a = "123";

String b = a.clone();

in this way, whatever you do to A in the future will not affect B ..

for example, use bytebuffer to trap a, and then modify its value. Then b will change with it.

in addition, there is a group purchase of products on the webmaster group, and the price is guaranteed.