![]() |
|
#1
|
|||
|
|||
converting an unsigned char to an int?hi i have s specific string of 8 bytes in my program which i have collected using the following code
CPP / C++ / C Code:
when i print out unixtime i get 45d732f6 which is ok but i want to store this value in an int called uTim. I also want to proceed my string with '0x' so that it is recognised as a string of hex. In an ideal world something like CPP / C++ / C Code:
is it possible to convert unixtime into and int? thank you Last edited by LuciWiz : 06-Apr-2008 at 12:09.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#2
|
|||
|
|||
Re: converting an unsigned char to an int?If you are looking to convert a string to an int/long value, you can always use strtol. strtol will allow you to specify a base to use in the conversion so that you do not have to worry about prepending the 0x to your existing data.
|
Recent GIDBlog
More photos on Flickr by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Linker Error | athika_32 | C Programming Language | 6 | 03-Dec-2007 07:38 |
| Could someone please look this over? | clarjon1 | C++ Forum | 4 | 10-Jan-2007 07:05 |
| Pointer initialization causing program abend? | emanresu | C Programming Language | 0 | 12-Dec-2006 10:36 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 07:10 |
| (read/write file) newbie need help plz | momotx | C Programming Language | 6 | 28-Jan-2004 13:40 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The