- getc() is used to reads a character from a file.
- The file pointer moves by one character position for every operation of getc().
- The getc() will return an end – o f – file marker EOF, when the end of file has been reached.
- The reading should be terminated when EOF is encountered.
- It read characters one by one that is one character at a time.
Ex:
while
(( c = getc( fp )) != EOF )
{
printf
(“ %c ”, c);
}
No comments:
Post a Comment