dave
Joined: 21 Dec 2003 Posts: 7 Location: Sheffield, South Yorks, UK
|
|
Posted: Thu Oct 14, 2004 12:33 pm |
|
|
Use the sprintf() function as described in the CCSC manual, as is pasted below.
Code: | SPRINTF()
Syntax:
sprintf(string, cstring, values...);
Parameters:
string is an array of characters.
cstring is a constant string or an array of characters null terminated. Values are a list of variables separated by commas.
Returns:
Nothing
Function:
This function operates like printf except that the output is placed into the specified string. The output string will be terminated with a null. No checking is done to ensure the string is large enough for the data. See printf() for details on formatting.
Availability:
All devices.
Requires
Nothing
Examples:
char mystring[20];
long mylong;
mylong=1234;
sprintf(mystring,"<%lu>",mylong);
// mystring now has:
// < 1 2 3 4 > \0
Example Files:
None
|
regards Dave |
|