Week 2: C Fundamentals Flashcards
What are the two main ways of changing programs to machine language?
Compilers and Interpreters
What is source code?
Code written in a programming language by a developer
What is a compiler?
A computer program that transforms code from one format to another (needs a different compiler depending on what system you are using)
What is an interpreter?
A program that translates and executes code, usually translates and executes source code line by line. There is no object code written as an intermediary
What is primary and secondary memory?
Primary memory: mechanism to present memory to the CPU, is temporary
Secondary memory: stores memory, is permanent
What is C?
A general purpose, procedural computer programming language supporting structured programming, lexical variable scope, and recursion, with a static type system
Who developed C?
Bell Labs: Ken Thompson, Dennis Ritchie, and others
Why was C originally developed?
To design and support Unix operating system
Benefits of C:
- Intended as a language for programmers
- Powerful and efficient
- Structured
- Standardized
What three steps are necessary for a program to be executed?
Preprocessing, compiling, and linking
What is preprocessing?
Finds and deals with processing commands (directives) starting with a #
What is compiling?
Translating the program into machine instructions
What is linking?
Combining the object code produced by the compiler with any additional code needed to yield a complete executable program
What is the UNIX compile command and its syntax? (For C)
gcc
Syntax: { gcc -o nameOfExecutable program.c }
What are the three key language features of C?
- Directives
- Functions
- Statements
What do directives always begin with?
#