+ 1
Why is %c and %s in getchar & gets
2 Respostas
+ 1
Sufal Kadariya Read the lesson and associated comments patiently:
https://www.sololearn.com/learn/C/2914/?ref=app
+ 1
%c and %s aren't in getchar and gets because we don't pass an actual argument to getchar, instead getchar returns ascii value of the entered value to the char variable. In gets the base address (the address of the zeroth element in the string) is passed to function gets then gets receives the user input and writes it to the string you passed the base address of .
If you don't understand me then go through the topics of strings, functions, arrays and pointers.