sir not able to get this….
sir not able to get this….
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
getchar function takes input from stdin character by character.its stored in a variable c.&that’s compared with EOF.EOF stands for END OF FILE.we use this while reading characters from a file.but here the character is read from stdin.so as per my understanding this loop has no use.
plz ignore my first comment.getchar returns the next character of keyboard input as an int. If there is an error then EOF (end of file) is returned instead.hence we need to compare it with EOF.variable c must be an int type.to come out of this loop we need to press cntrl-d from stdin.which internally generates a signal & getchar evaluates this error as EOF.