The use of sprintf
sprintf, how much do you know?
from the CSDN Community Electronic magazine--c/c++ magazine
When you construct various types of data into strings, the powerful features of sprintf rarely disappoint you. Because sprintf is almost
Program use cases for the sprintf () function:
#include
#include
int main (void)
{
Char buffer[80];
sprintf (buffer, "an approximation of Pi is%f\n", M_PI);
puts (buffer);
return 0;
}
The role of sprintf is to output a formatted string to a
When constructing various types of data into strings, the powerful features of sprintf seldom disappoint you. Since sprintf and printf have almost the same usage, but the printing destination is different, the former is printed into the string, and
1. ITOA function prototype
Char * ITOA (INT value, char * string, int Radix );
Converts an integer to a string.
Value: the integer to be converted.
String: the variable that saves the converted string.
Radix: Number-based conversion (10, 8, 2,
When constructing various types of data into strings, the powerful features of sprintf seldom disappoint you. Since sprintf and printf have almost the same usage, but the printing destination is different, the former is printed into the string, and
Introduction to sprintf usage
From csdn Community Electronic Magazine-C/C ++ magazine
When constructing various types of data into strings, the powerful features of sprintf seldom disappoint you. Since sprintf and printf have almost the same usage,
Printf may be the second function that many programmers encounter when learning C language (I guess the first function is main). It is naturally an old friend. However, do you know much about this old friend? Do you know more about sprintf? When
When we write the program, we often encounter the problem of integer type and string conversion, here to use a few functions, itoa (), Atoi (), sprintf () below to introduce the specific use of these functions!ItoaFunction: Converts an integer to a
Selected "CSDN Community e-magazine--c/c++ magazine"Http://emag.csdn.net January 2005 Issue 1-93-Author: steedhorse (Morningstar)printf is probably the second function that many program apes come into contact with when they start learning C (I guess
Printf may be the second function that many programmers encounter when learning C language (I guess the first function is main ),
Naturally, it's an old friend. But do you know more about this old friend? You know more about sprintf.
? When
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.