Coders, Why the compiler (inerpreter) overlaps the gets() and puts() function ????? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Coders, Why the compiler (inerpreter) overlaps the gets() and puts() function ?????

I have used getchar(), putchar(), scanf(), gets() and puts() function in a same program under separated variable names. The problem occuring with it that the compiler is overlapping the gets() and puts() function. The same problem occurs with fgets() and fputs() function. For understanding deeply check out my code. Now will you tell me the reason for that. Why is this happening ? https://code.sololearn.com/cF5g6k0Oue2H/?ref=app

6th May 2019, 4:23 AM
Vikash Kumar
Vikash Kumar - avatar
2 Answers
+ 8
The 'printf' function has a special formatting character (%) — a character following this defines a certain format for a variable:   %c — characters   %d — integers   %f  — floats printf("%c %d %f", ch, i, x); NOTE: Format statement enclosed in "..." , variables follow after. Make sure order of format and variable data types match up. scanf() is the function for inputting values to a data structure. Its format is similar to 'printf' :     scanf("%c %d %f", &ch, &i, &x); NOTE: & before variables.
6th May 2019, 5:00 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 3
Your puts() need an argument, second page in this lesson https://www.sololearn.com/learn/C/2914/
6th May 2019, 4:44 AM
Gordon
Gordon - avatar