|
-
May 21st, 2002, 02:06 AM
#1
How to i Convert Hex int Value.
Hi,
How do i conver the Hex value to Integer value. for example
i am having the Hexvalue is "1E2EE"( for ex: int 30 = 1E(Hex Value ), int 750 = 2EE(hex vlaue) )
How do i Conver Hex to Int do that?...
CString csTemp = "1E2EE";
how do i convert to Int?...
any help pl.
i am using VC++,MFC
Rajesh. S
-
May 21st, 2002, 02:31 AM
#2
In order to convert a hex number stored in a String as like this
char str="1E2EE"; <- if this is the value we have
int val;
sscanf(str,"%x",&val); <- now val has an integer value taken from the string
This above code executes in all types of programing methods like MFC / C/C++ . And in the place of str variable in sscanf you can also have a dynamic string variable or type cast a CString object using (LPCSTR)
Regards
Nagendra
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|