Instructions Circuit Diagram
- 76 -
Basic structure for a ‘C’-program
Basically a ‘C’-program minimally requires the following structure:
int main(void){
return 0;
}
‘int’ is the type for the main function
‘main’ is the name for the main function
‘void’ indicating ‘no entry’
‘return 0’ is the return value for the ‘main’-function.
# As a general rule each ‘C’-instruction has to be terminated by a semi-
colon, except a block terminator (terminating bracket).
# Programmers Notepad2 will automatically display the source code in
predenedcolorsaccordingtosomespecialcategories.Syntaxorspe-
cic‘C’-keywordswillbecoloredgreen,wherasnumbersaredisplayed
in red and comments will be written in blue.
# You may insert comments virtually anywhere, following ‘//’ or between
‘/*’ and ‘*/’
int main/*intermediate text line*/(void){ /*any text lines*/
//one line of text
/* text lines
*/
return 0; //any text
/*
some more text lines
*/
}