Help me to solve this problem(about a display)!Thanks!

tools:VC++.net
the code is:

char ch;
ch = 'a';
MessageBox::show(ch.ToString());

After this code runned!The MessageBox showed '97'.It shows the alphal's ASCII number,not show 'a'.
How can I fix this problem
Thanks!  



Answer this question

Help me to solve this problem(about a display)!Thanks!

  • jimg43

    Hi,


    Ok, you can do this instead.

    char c = 'a';

    MessageBox::Show(Convert::ToChar(c).ToString());


    Hope that works...



    cheers,



    Paul June A. Domag

  • sramshaw

    to Paul Domag
    Thank you very much!
    It's all right!


  • C.P.Hardcastle

    Hi,


    you could do this:

    char ch;
    ch = 'a';
    // cast it to a System::Char type
    MessageBox::show((System::Char) ch);




    cheers,



    Paul June A. Domag


  • riddler_69

    Try Convert.ToString(ch)


  • Zoltan Magyar

    Have you tried using StringBuilder

  • NickP

    to hauptman
    Thanks!
    But it can't show 'a'.
    it also show '97'.



  • RickSolie

    to Paul Domag
    Thanks!
    But when complied this code,there was a error which said "can't convet paramete 1  (from _wchar_t )"


  • Help me to solve this problem(about a display)!Thanks!