Translate

Labels

Friday 21 December 2012

HOW TO DENOTE END OF FILE

How CTRL+Z can be used to denote end of file:
main()

{
int c;
print("Enter the character (CTRL+Z to end):");
c=getchar();
if(c!=EOF)
printf("End of file not encountered ");

o/p:
Enter the character (CTRL+Z to end):d
End of file not encountered.

No comments: