1 //See the value of EOF2 3#include <stdio.h>4#include <stdlib.h>5 intMainvoid)6 {7printf"the value of EOF is represented by a number:%d\n", EOF);8System"Pause"); 9 return 0;Ten}
1 //Verify the value of GetChar ()! = EOF2 3#include <stdio.h>4 5 intMainvoid)6 {7printf"Press a button, ctrl+d or CTRL + Z to represent eof\n");8printf"expression GetChar ()! = EOF has a value of%d\n", GetChar ()! =EOF);9System"Pause");Ten return 0; One}
Results: Ctrl+d---> 1; Ctrl + Z---> 0
#include <stdio.h>intMainvoid){ //Note: It is recommended to use the standard escape character (\n,\t,\b,\ ", \ \ \"), and if nonstandard escape characters are used, the result will become unpredictable (such as the following \a,\f,\r,\v)printf"\\Audible or Visual alert. \a\n"); printf ("Form feed. \f\n"); printf ("This escape, \ r, moves the active position to the initial position of the current line.\n"); printf ("Vertical tab \v is tricky, as it behaviour is unspecified under certain conditions.\n"); return 0;}
#include <stdio.h> int main (void) { printf (" The values of EOF are expressed in numbers as:%d\n", EOF); return 0 ;} Results:1
C Foundation Consolidation