Magnivus

Hi!

I have a following problem:

array<Char>^ get_me = gcnew array<Char>(16);

array<Char>^ result_hex=gcnew array<Char>(32);

the data containted in get_me need to be displayed in hexadecimal format and stored in result_hex.

The classic method of sprintf doesnt work in C++ managed . Can somebody help me, what i need to do

Thanks a lot!




Re: Visual C++ Language Quick question in C++ managed regarding <char>

Sheng Jiang (?)

Use Int:Stick out tonguearse and String::Format






Re: Visual C++ Language Quick question in C++ managed regarding <char>

Magnivus

can you explain more detailed, plz




Re: Visual C++ Language Quick question in C++ managed regarding <char>

Sheng Jiang (?)

convert your char array to string

use Int32:Stick out tonguearse to convert your string to decimal int

Use String::Format to convert your decimal int to hex string

convert string to char array






Re: Visual C++ Language Quick question in C++ managed regarding <char>

David Anton

Actually, sprintf does work in C++/CLI. Within your method within a managed class, you can still declare char pointers and use sprintf and most of the other 'classic' C++ functions.