What is the difference between GETS();AND SCANF();
Answer Posted / vignesh1988i
the main difference between gets() and scanf() function is that while getting any input as a stream of characters or as a string using scanf() , the end termination character is a blank space or an enter key for scanf() , so upto blank space it will be saving it in the memory...... SHORTLY it ignores the characters comin after and with blank spaces........
in gets() , it allows with the blank spaces and the termination condition is a enter key (\n) ,
but a inside gets() function , surely they would have used scanf() function , but the difference is that the input inside gets() would go character by character , so only gets() can allow with the blank spaces...........
thank u
Is This Answer Correct ? | 103 Yes | 47 No |
Post New Answer View All Answers
What is a union?
How do I create a directory? How do I remove a directory (and its contents)?
how to create duplicate link list using C???
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
how do you programme Carrier Sense Multiple Access
Subtract Two Number Without Using Subtraction Operator
Is r written in c?
Write a program to check whether a number is prime or not using c?
Is c still used?
Can include files be nested?
Describe how arrays can be passed to a user defined function
What is function prototype in c with example?
Why is c called a structured programming language?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
define string ?