What is the meaning of %s in c? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the meaning of %s in c?

26th Apr 2021, 6:08 AM
Arin Bagul
Arin Bagul - avatar
3 Answers
+ 4
It's a format specifier that is used for strings.
26th Apr 2021, 6:47 AM
sarada lakshmi
sarada lakshmi - avatar
+ 1
And also you can use it for characters in place of '%c'...
27th Apr 2021, 9:24 AM
Aryan Raj
Aryan Raj - avatar
+ 1
Arin Bagul %s tells printf that the corresponding argument is to be treated as a string (in C terms, a 0-terminated sequence of char ); the type of the corresponding argument must be char * . %d tells printf that the corresponding argument is to be treated as an integer value; the type of the corresponding argument must be int https://stackoverflow.com/questions/9026980/what-does-s-and-d-mean-in-printf-in-the-c-language#:~:text=%25s%20tells%20printf%20that%20the,corresponding%20argument%20must%20be%20int%20.
27th Apr 2021, 10:01 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar