To program in C you need to follow some rules for the correct construction. Rules Work for functions, expressions, statements and types:
- Types are the properties of the data used in a program.
- Explanations are parts of the program where they give meaning to an identifier, allocating space in memory, define roles.
- Functions are actions that a program must meet as running. The union of the various functions are basic operational entities in C.
- Determination and modification of values, are called I / O functions defined by expressions.
There are functions that are already defined in C library, as printf () andscanf (), which respectively mean write on the screen and read the data entered. Despite the existence of these functions in the library, programmer can also create your own functions, which perform calculations or other.
Every C program starts with the mandatory function main () The comments are expressed by / * and * /, which are ignored in the program. Every statement that is closed, shall be used ; (Semicolon) that ends the line of inquiry.
Example of a basic structure:
main () / * function binding * /
It’s the same example used in the first post, but with further explanation.