0% found this document useful (0 votes)
144 views

1.14 Basics of A Typical C Environment: Phases of C Programs: 1. Edit 2. Preprocess 3. Compile 4. Link 5. Load 6. Execute

The document describes the typical process of a C program from creation to execution. It involves editing the source code, preprocessing it, compiling it to create object code, linking the object code with libraries, loading the program into memory, and executing it on the CPU. The CPU then executes each instruction and stores new data values as the program runs.

Uploaded by

Er Ashish Baheti
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
144 views

1.14 Basics of A Typical C Environment: Phases of C Programs: 1. Edit 2. Preprocess 3. Compile 4. Link 5. Load 6. Execute

The document describes the typical process of a C program from creation to execution. It involves editing the source code, preprocessing it, compiling it to create object code, linking the object code with libraries, loading the program into memory, and executing it on the CPU. The CPU then executes each instruction and stores new data values as the program runs.

Uploaded by

Er Ashish Baheti
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

14 Basics of a Typical C Environment


Editor Disk

Program is created in the editor and stored on disk. Preprocessor program processes the code. Compiler creates object code and stores it on disk. Linker links the object code with the libraries, and stores it on disk

Preprocessor

Disk

Phases of C Programs: 1. Edit 2. Preprocess 3. Compile 4. Link 5. Load 6. Execute

Compiler

Disk

Linker

Disk
Primary Memory

Loader

Disk

Loader puts program in memory.


. . . . . .

Primary Memory

CPU

. . . . . .

CPU takes each instruction and executes it, possibly storing new data values as the program 1 executes.

Basic Structure of C++ Program


1.

Documentation Section
Single Line Comment Multiline comment This is an optional section.

2.

Preprocessor Directives
Compiler preprocessor statements. Link compiler functions like cout, cin, sqrt, clrscr, etc. with the INCLUDE subdirectory having header files like iostream.h, conio.h #include<header file>

3. Global Declaration Section (variable or functions) 4. Main program function called main() 5. Beginning of the program: Left brace {
Local declaration Executable part

6. End of main program } 7. Sub-program section or user defined program

Variable Constant Identifier Keyword Data type

You might also like