Tuesday, September 16, 2008

LEARNINGS OF THE WEEK (Laraflyn B. Camay)

Our lesson last week, Sept. 8-12, 2008 is all about the C programing language.

The c program is composed of 3 functions: the main function, the function greet1 and the function greet2.

So, we can make a program that is made up of other function aside from the main function.

The main( ) function should always be present in every C program.

Functions are the building blocks of C in which all program activity occurs. It is also called a subprogram or subroutine. It is a part of a C program that performs a task, operation or computation then may return to the calling part of the program. Other functions aside from the main( ) can only be executed by the program through a “function call”.

Function call is a C statement that is used to call a function to execute C statements found inside the function body.

Going back to the example, greet1( ); is an example of a function call, calling the function greet ( ). main ------clrscr------printf greet1( ) function call------greet1( ) functiongreet2 function call----greet2( ) function getch( )

FILE TYPES are
a. alloc.h – declares memory management functions.
b. conio.h – declares various functions used in calling IBM-PC ROM BIOS.
c.ctype.h – contains information used by the calssification and character convertion macros.
d.math.h – declares prototype for the math functions.
e. stdio.h – defines types and macros needed for standard I/O.
f. string.h – declares several string manipulation and memory manipulation routines.

A Symbol is a line char used to move the cursor to the next line

‘ ‘ – single quote is used for single character / letter.
“ “ – double quote is used for two or more character
{ - open curly brace signifies begin
} – close curly brace signifies end
& - address of operator
* - indirection operator / pointer

STRUCTURE:
#include directive – contains information needed by the program to ensure the correct operation of C’s Standard library functions.
#define directive – used to shorten the keywords in the program.
Variable declaration section – it is the place where you declare your variables.
Body of the program – start by typing main() and the { and }. All statements should be written inside the braces.

No comments: