Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Long type conversion

Status
Not open for further replies.

ironmunk

Technical User
Aug 21, 2001
51
CA
Is there a way to convert LONG data types to char* or strings? I want to be able go through each number of the variable individually.
 
Yes, the function is prototyped in stdlib.h:

char *_ltoa( long value, char *string, int radix );
 
can you give me some sample code?

(char*) x;?
 
char str[100];
unsigned long num = some number;

_ltoa (num, str, 10)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top