CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Posts
    31

    convert hex to int

    Hi folks
    I have the following

    dbgprint("Lower provider socket = 0x%x LSP Socket = 0x%x\n", NextProviderSocket, NewSocket);

    which outputs the hex value of NextProviderSocket, NewSocket..
    How can i convert that to integer value?? what is the conversion code??

    would appreciate your response

  2. #2
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    Change %x to %i for displaying signed integers, or to %u for unsigned integers.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  3. #3
    Join Date
    May 2001
    Location
    Germany
    Posts
    1,158
    lookup the format expressions for the printf family. Your dbgprint makes definitely use of one of them.

  4. #4
    Join Date
    Nov 2003
    Posts
    31

    Thumbs up

    Thank you very much for your help... you solved my problem.

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