Tuesday 19 March 2013

FILE *ptr;


    #include<stdio.h>
main()
{
FILE *ptr;
char i;
ptr=fopen("zzz.c","r");
while((i=fgetch(ptr))!=EOF)
printf("%c",i);
}
Answer:
contents of zzz.c followed by an infinite loop 
    Explanation:
The condition is checked against EOF, it should be checked against NULL.


Blog Author: Vijay Kumar

Go to: Java Aptitude


No comments:

Post a Comment