how to convert a integer from hex to decimal
-
An integer is neither an hex or a decimal. It's an integer and that's it ! Now, it's representation (so you will print it on the screen, in a file, ...) can change from hew to decimal. But then, it's not converting an integer but converting a string.
-
hex, dec, oct are just ways to represent the same integer... ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-
An integer is neither an hex or a decimal. It's an integer and that's it ! Now, it's representation (so you will print it on the screen, in a file, ...) can change from hew to decimal. But then, it's not converting an integer but converting a string.
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love Programming -
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love Programmingan integer is an integer !!!! it is stored as a serie of bits in memory, wether you stored an hexa value, an octal one, or a decimal one...
int i = 0x05;
//i contains00000000 00000000 00000000 00000101
int i = \005;
//i contains00000000 00000000 00000000 00000101
int i = 5;
//i contains00000000 00000000 00000000 00000101
TOXCCT >>> GEII power
[toxcct][VisualCalc] -
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love ProgrammingTake a look at the sprintf function instead. It will do what you are looking for (and even much more ;) ). Hexa:
sprintf(Buffer,"%x",Number);
Decimal:sprintf(Buffer,"%d",Number);
-
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love ProgrammingAn integer is an integer and it doesn't matter how you represent it. If you are trying to print it in different representations you may take a look to print flags[^]. Marc Soleda. ... she said you are the perfect stranger she said baby let's keep it like this... Tunnel of Love, Dire Straits.
-
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love Programming -
yes, the diffrent is the string's represent format, i know how to represent a integer to diffrent format string as
char *_itoa( int value, char *string, int radix );
butint atoi( const char *string );
the function has only one param, no format param must i write a function to do this? I love Programming