STRUCTURE OF A SIMPLE C PROGRAM
BY: Sharra Mae S. Tagaro IV- Rizal
BY: Sharra Mae S. Tagaro IV- Rizal
This week, we discussed more about C language- specifically its structure.
Structure of a simple C program
Structure of a simple C program
#include
#define directive
main()
{
variable declaration section;
______________________
______________________
}
variables.
- n#include directive – contains information needed by the program to ensure the correct operation of C’s Standard library functions.
n#define directive – used to shorten the keywords in the program.
nVariable declaration section – it is the place where you declare your
nBody of the program – start by typing main() and the { and }. All statements
Commonly used include files in C language. Important Symbols
- nalloc.h – declares memory management functions.
- nconio.h – declares various functions used in calling IBM-PC ROM BIOS.
- nctype.h – contains information used by the calssification and character convertion macros.
- nmath.h – declares prototype for the math functions.
- nstdio.h – defines types and macros needed for standard I/O.
- nstring.h – declares several string manipulation and memory manipulation routines.
- n\n – is a line char used to move the cursor to the next line
- n‘ ‘ – single quote is used for single character / letter.
- n“ “ – double quote is used for two or more character
- n{ - open curly brace signifies begin
- n} – close curly brace signifies end
- n& - address of operator
- n* - indirection operator / pointer
No comments:
Post a Comment