Hi all,
How does a reading function , eg scanf() or fgets(), mark the end of an input string(character)? with EOF , NULL ,'\0' , or '\n'?
Take a look at these these snippets, do they want to test the end of a stream? but in vc, NULL is defined as 0, and EOF is -1.......headache....
Code:if (fgets(buf, sizeof(buf), stdin) != NULL)Code:while ((c = fgetc(fp)) != EOF)so, how should i test the end of a stream?Code:while (!feof(fp))
any advice would be appreciated! thanks!