Monday, August 12, 2019

CS2100 - C Overview

1) High level to Machine code

Translator:
- Translate a source language into a target language for a program

Compiler:
- A translator whose source is a high level language

Interpreter:
- A translator that translates and executes a source program


2) Compiled program
The entire program is compiled before the execution

(Compiler)
Compiler: Compile program into assembly language
Assembler: Assemble program to machine language
Linker: Link multiple machine language programs into one executable

(OS)
Load executable into computer's memory
Execute executable

3) Interpreted program
Compilation happens on the fly during execution

(Interpreter)
Compile,Assemble,Link -> Load, execute

4) Traits of C
- Efficient in exe speed, mem footprint

5) Basic Elements
- C always starts execution from the int Main() function
- Each Variable is allocated a space in the RAM

6) Data Type Conversion
Implicit: Performed Automatically based on rules
Explicit: Programmer can dictate data type change
Char -> Int -> Float -> Double
Using type casting, we can promote/demote a value.
e.g
(double) 2/5 -> 0.4 (2 is promoted to 2.0)

Refer to L02 for more C references



Next>

No comments:

Post a Comment