Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2002
    Location
    Brazil
    Posts
    8

    Question Unanswered: Needing help in C++.................. (hexadecimal)

    Hi, people...

    I'm getting to Programming in C++, and I'm charging some difficulties! That's not about data access, but statements.

    How could I get the hexadecimal value from some variable, like this:::

    a = hex(49); 'this could return 31;

    I realized that I could use sprintf to get this result, but the problem is... I can't put this into a fputc, that ask me an int value, and the sprintf answer me a char!!!

    Could somebody give some help????

  2. #2
    Join Date
    Jul 2001
    Location
    Germany
    Posts
    189
    Hello,

    Sorry, but I don´t understand why you can´t use sprintf or Format when you are using MFC

    Can you please explain exactly, what you want to do ?

    Greetings

    Manfred Peter
    (Alligator Company)
    http://www.alligatorsql.com

  3. #3
    Join Date
    Dec 2002
    Posts
    4

    Re: Needing help in C++.................. (hexadecimal)

    Originally posted by Jessé Goncalves
    Hi, people...

    I'm getting to Programming in C++, and I'm charging some difficulties! That's not about data access, but statements.

    How could I get the hexadecimal value from some variable, like this:::

    a = hex(49); 'this could return 31;

    I realized that I could use sprintf to get this result, but the problem is... I can't put this into a fputc, that ask me an int value, and the sprintf answer me a char!!!

    Could somebody give some help????
    Try fputs instead:

    int fputs( const char *string, FILE *stream );

    Nathano

Posting Permissions

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