EOF means end of file but you did not open any file so how you expect it would work ?
int main (void) \\ no problem using these . it just says no arguments to main
example
int main( )
{
int a=40;
main(a); \\ you wont find any error with these
}
int main( void )
{
int a=40;
main(a); \\ you get error saying main function cant take arguments
}
main( ) it can take infinite arguments and whereas main(void) none arguments
Thats why when you use
getch(a) or clrscr(1) your passing arguments to these functions so you get error
because they are defined as clrscr( void ) getch (void )
strlen(char *) \\ can take only one argument
You can check out them in header files
Try these
c = 0; count = 0 ; initialize it so that you wont have any garbage value
while ((c=getchar)!='\n') or may be its AScll value
while ((c=getchar)!=13)
FILE *p;
p=fopen("hello.txt","r");
while ( c = getc(p) != EOF ) \ When it returns end of file while loop exits
Say You have these content in hello.txt
"hello world My name text file"
for every loop c has the character like h,e,l and when it returns to end it exits
So EOF mostly used with files I Hope you got the point