-
April 11th, 2005, 10:37 PM
#1
Junior Member
int to string in C
Say u have int i=90 and char str[2], where str[] is an array of chars ( aka string), would u recommend using memset or memccpy (from string.h> to make a string from an integer.
In my program, int can be any random number ( not a particular range of numbers) so u cant necessarily create a lookup table and use strcpy().
please get back asap cos its due this Friday.
cheers
-
April 11th, 2005, 10:57 PM
#2
I would use itoa(...) to convert an integer to a string in C:
http://www.mkssoftware.com/docs/man3/itoa.3.asp
ac
-
April 11th, 2005, 11:05 PM
#3
I would learn how to use google and how to do proper research so I could do my own homework.
"When I get a little money I buy books; and if any is left I buy food and clothes." - Erasmus
"There is no programming language, no matter how structured, that will prevent programmers from writing bad programs." - L. Flon
"Mischief my ass, you are an unethical moron." - chsh
Blog of X
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
|
|