Tuesday, November 27, 2012

Exercise 1-7. Write a program to print the value of EOF


Kernighan Ritchie - The C Programming Language (Second Edition)
Esercise 1-7
Write a program to print the value of EOF


/*-------------------------------------------------*/
#include <stdio.h>
int main () {
       
    printf("\nValue of EOF: %d\n", EOF);
   
    return 0;
}
/*-------------------------------------------------*/

The result in my case is -1 .

NOTE
To insert an End Of File (EOF) on a Mac console you need to press "CTRL + D"

No comments:

Post a Comment

Your comment will be visible after approval.