#include <stdio.h>//the. h file is a header file; Stdio refers to "standard input & Output", so it is necessary to include the header file when using the standard input/output function; header file definition: 1, #include <stdio.h > 2, #include "stdio.h"intMain ()//when there is a return value: Data type function name (), if required: Data type function name (data type variable); no return value: void function name (); if variable: void function name (data type variable){printf ("hello,word\n");//\ n is a line break, or two: printf ("Hello,word"); printf ("\ n");return 0;//Return indicates that the function returned from the callback to the key function continues execution, which can be returned with a return value specified by the argument following return. If function execution does not need to return the result of the calculation,}//It is also often necessary to return a status code to indicate whether the function is performing smoothly (-1 and 0 are the most commonly used status codes) if you have a return type definition in front of the name, such as int,double, you must have a return value,//In the case of void type, the return is not written, but the value cannot be returned even if it is written.
View Code
The functions contained in the stdio.h:
File access |
Binary input/output |
Non-formatted input/output |
Format Input/Output |
Format Input/Output |
File location |
Error handling |
File operations |
fopen Freopen Fflush Fclose |
Fread Fwrite |
Fgetc/getc Fputc/putc Ungetc Fgets Fputs |
Fgetc/getc Fputc/putc Ungetc Fgets Fputs |
scanf/fscanf/sscanf printf/fprintf/sprintf Perror |
Ftell Fseek Fgetpos Fsetpos Rewind |
Feof Ferror |
Remove Rename Tmpfile |
Common data type ranges:
1, simple program "Hello,word"