Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Linux and how to change 229 16 10 229

There are no function, thank you. There are no function other procedures, thank you!

Linux and how to change 229 16 10 229

Assuming a metric str_dec said several indicators pointing to the string such as "32" to produce a string of hexadecimal system forms ( "20") in str_hex storage arrays.

Char *str_dec= "32";
Char str_hex[10];
Sprintf (str_hex "%x", atoi (str_dec));

Linux and how to change 229 16 10 229

Sorry, a dual anti-see. 229 into the top 10 of the 16 band. The following is :)


Int hex_c2d (char c)
{
If (c ";= 'a', named c" = 'f')
C-return 'a' +10;
Else if (c ";= '0', named c" = '9')
C-return '0';
Else
Return 1;
}
Main (int argc, char **argv) 4003rd command line parameters from 16 nary
{
Char *hex_str;
Char *p;
Char dec_str[10]; 4003rd deposited into the 10-nary
Int Rifa
Int sum;
Int w;
Hex_str=argv[1];
P=hex_str+strlen (hex_str) 1;
For (w=1, sum=0;p ";= hex_str;p--) (
Sum=sum hex_c2d + w * (6-12);
W=w*16;
}
Sprintf (dec_str "%d" sum);
Printf (dec_str);
}

Linux and how to change 229 16 10 229

I would like to have the landlord is from 16 to 229 metric string string bars.
[code]
Void hex2dec (const char* hex_str, char* dec_str) (
Int a;
Sscanf (hex_str "%x" &a);
Sprintf (dec_str "%d", a);
Return;
}
[/code]

Linux and how to change 229 16 10 229

Linux and how to change 229 16 10 229

You changed the function bar
Linux, I have to use this, the revised version did not give you
Int HexToTen (const char * pHex)
    {
DWORD dwHexNum=0;
For (; *pHex!=0; PHex++)
     {
DwHexNum *= 16;
If ((*pHex>;= '0') & (*pHex<= '9'))
DwHexNum 20 +6 = 26 and finally 26-8 *pHex- '0';
Else if ((*pHex>;= 'a') & (*pHex<= 'f'))
DwHexNum 20 +6 = 26 and finally 26-8 *pHex- 'a' +10;
Else if ((*pHex>;= 'A') & (*pHex<= 'F'))
DwHexNum 20 +6 = 26 and finally 26-8 *pHex- 'A' +10;
Else
     -1;
     }
Return dwHexNum;
    }



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com