ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
so this is the whole process , but now can you tell me at start we are sending 0 in "in" , so what is the meaning of "in" in this program , and please clarify this with an example !
Always use [code] and [/code] tags when quoting source.
Passing NULL means default value, in this case reading from FILE stdin, instead of character-buffer.
Note: This program seems to implement scanf and sscanf together. In real-life cases scanf simply calls fscanf, and fscanf and sscanf are implemented together.
scanf calls scan (in=NULL), scan calls scanchar (in=NULL), and scanchar calls getchar; finally each call of getchar fetches a character from stdin.
If you are asking about the working of scanf: yes, a single scanf may result in reading zero or more lines from user, depending on the contents of buffers and the content of lines, which can be confusing; that's why many people prefer fgets+sscanf over scanf.
if .... in == NULL ... means you will read nothing & if == something than it will be read by getchar() , ok
but when will we get this "in == NULL ... means you will read nothing" condition ... according to me this condition will come when we press "ctrl+z" .... now what about your's ?
thanx NevemTeve , you have beautiful mind , wow genius man !
.
i think you can play with "C"
.
hello another query , are you in social network , i want to stay in touch with you !
Last edited by tushar_pandey; 07-13-2012 at 05:21 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.