Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Tell me is null always defined as 0(zero)?

1087


Why is it important to memset a variable, immediately after allocating memory to it ?

2075


What is #line in c?

1014


How can a program be made to print the line number where an error occurs?

1089


What is scope and lifetime of a variable in c?

1063


Tell me what are bitwise shift operators?

1132


What is an auto keyword in c?

1099


Explain what is output redirection?

1195


How can I read data from data files with particular formats?

1048


What is the use of getchar functions?

1183


What are the types of arrays in c?

1177


any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above

1118


What is storage class?

1074


Why doesnt the call scanf work?

1195


Why calloc is better than malloc?

1036