CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: UINT to Char

  1. #1
    Join Date
    Jun 1999
    Posts
    9

    UINT to Char

    Looking for a function that converts UINT to a char and then back to a UINT.
    <BR>
    void CGridCtrl::OnCharDown(UINT *vcKey,BOOL processed)
    <BR>
    Need to change all character key presses to uppercase ini the OnCharDown.


  2. #2
    Join Date
    Jun 1999
    Posts
    1

    Re: UINT to Char

    It's very simple:

    char c;
    UINT u;
    c = (char)u;






  3. #3
    Guest

    Re: UINT to Char

    believe there is a ultoa or ltoa function who will do that


  4. #4
    Join Date
    Apr 1999
    Posts
    383

    Re: UINT to Char

    You don't need a function, just cast between the two:

    UINT foo;
    char bar = static_cast<char>(foo);



    Dave


  5. #5
    Join Date
    Apr 1999
    Posts
    383

    Re: UINT to Char

    > believe there is a ultoa or ltoa function who will do that

    You believe wrongly.

    ltoa (ultoa) will convert a (unsigned) long integer to a string.

    Dave


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured