PDA

View Full Version : Needing help in C++.................. (hexadecimal)


Jessé Goncalves
03-07-02, 18:39
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????;)

alligatorsql.com
03-13-02, 20:55
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

nathan_bee
12-13-02, 09:20
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