CS 23021 Computer Science I - Detailed Contents
Fundamentals
- Compiling stages and purpose of each stage:
preprocessor, compiler, assembler, linker
- Include directives, purpose, effect
- Types of errors
-
main function
- C++ basics, variables, assignment statements, basic I/O
- Basic input, output
- Comments, purpose of comments
- Indentation, purpose of indentation
- Program development
Control Structures - Basics
-
if, if/else
-
while
-
switch
- Infinite loop
Variables, Expressions - I
- Variable
- Parts of the C++ language (core/built-in and libraries)
- Type, categories of type (built-in, programmer defined)
- Built-in types, general differences;
int,
char,
long,
double,
float,
unsigned,
bool,
sizeof() operator
- Literals, string literals
- Operator precedence, associativity
- Result and side effect
- Result and side effect for
pre-increment, post-increment,
pre-decrement, post-decrement,
assignment
- Result and side effect for
the << and >> operators
- Division of integers in C++
- Implicit conversion
- Explicit conversion
-
true and false
with regard to expressions and integer values
- Boolean expressions,
conversion of
bool values to/from integer values
- Understand expression evaluation
including those with mixed types and the following:
- Evaluating, order of evaluation
- Automatic/implicit conversions,
when do they happen,
what happens
- Casting/explicit conversion
- Using casting/explicit conversion to force implicit conversion
- Assignment operators
Variables, Expressions - II
- Order of operations in
&& and ||
- Character versus string
Using Functions
- Calling free functions
- Calling functions on objects
C++ string
- C++
string:
defining,
output,
input,
assignment,
concatenation,
append,
index,
compare,
size,
find,
substring
I/O
- More on >> and <<
- Character input
- Line input
- Output formatting
Control Structures - for loop
Arrays
- Defining
- Indexing
- Array in memory
Vectors
- C++
vector:
defining,
indexing,
finding size of,
looping through store/read elements,
using push_back()
- Vectors compared with arrays
Functions
- Function call
- Function definition
- Function prototype/declaration
- Two things necessary to use (call) a given function
(declaration and machine language .o file (or definition))
-
return statement
- Scope
- Block/local scope
- Program/global scope
- Shadowing
- Storage duration
- Automatic storage duration
- Static storage duration
- Dynamic storage duration (covered later)
- Parameter passing:
pass by value,
pass by reference,
pass by const reference.
- Returning values:
return by value,
return by reference,
return by const reference.
- Functions, result versus side effect approaches
- Putting functions in separate files
- Separate compilation, linking, header files
- Include guards
- Make command, dependency graph, writing rules
File I/O
- File I/O:
opening, testing for success of open(),
inputting, outputting, closing
- What happens when a file is opened
- The two names relating to a file in a program,
their meaning and purpose
- When does an input stream evaluate to false?
Structures, structs
- Defining
structs
- Structure objects
- Structure member
- Structures containing arrays, other structures
Pointers
- Pointer as variable that has an address for its value
- The
* operator (dereference)
- The
& operator (address-of)
- C-style string
Dynamic Memory Allocation
- Basic dynamic memory allocation:
dynamically allocate an object,
assign it a value, and
deallocate the object
More Control Structures
Covered If Time Permits
-
? : operator
- Namespaces
- Default parameter values
- Function overloading
Pointers and Arrays
- What an array name by itself denotes
- Pointers and arrays, pointer arithmetic
- Simulated pass by reference using pointers.
- Passing arrays to functions
Not Covered
- Bit operators
- Operator overloading
- The
-> operator
- Recursion details
- Much class stuff
- Default operations for a programmer defined type
- Destructor
- Constructor, default constructor