Title: Fundamentals of Programming with
1Fundamentals of Programming with C
- An overview of
- General Computer Programming Concepts, Techniques
and Tools - Using C as an implementation computer
programming language - A general and basic coverage of main C
programming constructs and capabilities,
strengths and weaknesses - Next step...
2Programming Fundamental Concepts (1 of 2)
- SDLC
- Process
- Documentation
- Program Structure
- program data logic (algorithm)
- modular
- a main program other modules
- function vs. procedure/subroutine
- Programming Style
- header
3Programming Fundamental Concepts (2 of 2)
- comments separate vs. in-line
- specifications
- Program Development Process and Environment
- editor
- compiler
- link/build
- run
- debug
- IDE - a modern environment
4C Programming Language - The ABC (1 of 9)
- C Programming Language Goals
- BCPL, B, C
- why C
- portability
- modularity, block structure
- efficiency
- compactness
- mid-to-high level language
- for professional programmers
- standardized
5C Programming Language - The ABC (2 of 9)
- C Program Structure
- header files
- pre-processing directives
- declarations
- data
- functions
- statements
- Declarations
- identifiers
- function names
- key or reserved words
6C Programming Language - The ABC (3 of 9)
- Statements
- termination character
- grouping statements within a block
- sequential vs. nested blocks
- module size and complexity
- Values and Variables
- variables vs. constants
- types
- simple or primitive
- complex
7C Programming Language - The ABC (4 of 9)
- numbers
- 10, 2, 8, and 16 radix
- representation
- conversion
- memory allocation
- variable declaration vs. initialization
- type matching
- type conversion
- local vs. global variables
- scoping
8C Programming Language - The ABC (5 of 9)
- Expressions
- Components
- variables and constants
- operands and operators
- evaluation rules
- Assignment
- lvalue vs. rvalue
- side effects
- oranges vs. apples
- safe programming
- hard-coded vs. parameterized
9C Programming Language - The ABC (6 of 9)
- I/O
- Output statement
- parameters
- conversion specifications
- fields
- width
- justification
- precision
- escape sequence
- safe programming
- Input statement
- parameters
- conversion specifications
10C Programming Language - The ABC (7 of 9)
- fields
- width
- justification
- precision
- escape sequence
- safe programming
- Named constants
- How and why?
- conversion
- const declarations
- safety rules
11C Programming Language - The ABC (8 of 9)
- pre-processor macros
- rules
- safety rules
- when and how to use them
- Functions
- declaration vs. definition
- prototyping
- naming convention
- arguments/parameters
- formal
- actual
- order and type matching
12C Programming Language - The ABC (9 of 9)
- return value
- return
- declaration
- type
- examples
13Intermediate C Programming Concepts (1 of 6)
- Expression
- relational operators
- logical operators
- evaluation expressions
- logical values of expressions
- Boolean logic - truth tables
- Structured Programming
- spaghetti code
- Hoare, Dijkstra, Dahl, Jacopinni
- sequence, decision (selection), looping
(iteration)
14Intermediate C Programming Concepts (2 of 6)
- Fundamental Statements
- while statement
- structure
- initialization
- condition
- iteration
- execution
- special cases
- nesting
- do statement
- structure
- initialization
15Intermediate C Programming Concepts (3 of 6)
- condition
- iteration
- execution
- special cases
- nesting
- for statement
- structure
- initialization
- condition
- iteration
- execution
- special cases
- nesting
16Intermediate C Programming Concepts (4 of 6)
- Increment and Decrement Operators
- why and how
- meaning and significance
- example
- Decision/Selection Statement
- structure
- initialization
- condition
- execution
- special cases
- if-else
17Intermediate C Programming Concepts (5 of 6)
- nesting
- Switch and Break Statements
- why and how
- structure
- initialization
- condition
- execution through selection
- break statement
- special cases
- nesting
18Intermediate C Programming Concepts (6 of 6)
- Conditional Operator
- why and how
- execution
- special cases
- Comma Operator
- why and how
- execution
- special cases
- I/O Redirection
19More Intermediate Topics (1 of 4)
- Types and Conversions
- bit, byte, and memory addresses
- byte size and order
- word and word size
- memory addressing mechanism
- alignment
- Signed and unsigned values
- Type Representations
- Integer int
- signed vs. unsigned
- short and long
20More Intermediate Topics (2 of 4)
- Character char
- constants const
- escape sequences
- float
- double
- long double
- Extending the Simple/Primitive Types (Complex
Data Types) - typedef
- size_t
- sizeof operator and portability issue
21More Intermediate Topics (3 of 4)
- enumerated type enum
- bitfields and low level programming
- Type Conversion
- why and how
- casting
- promotion
- demotion
- implicit vs. explicit conversions
- conversion during assignment and initialization
22More Intermediate Topics (4 of 4)
- Passing Arguments to Functions
- void type
- type casting
- Formatting Strings
- width and precision
- printing characters
- printing integers
- printing floating-point
- printf and scanf revisited
23Complex Data Types Pointers and Arrays (1 of 5)
- Complex Data Types
- One-dimensional Arrays
- declaration and naming convention
- initialization
- explicit
- implicit
- manual vs. iteration
- processing, parsing, update
- boundary checking
24Complex Data Types Pointers and Arrays (2 of 5)
- Pointers
- declaration
- indirection operator
- address-Of operator
- const in pointer declaration
- pointers arithmetic
- Pointers and Arrays
- Pointers and Function Arguments
- Pointers to arguments
- Pointers to functions
25Complex Data Types Pointers and Arrays (3 of 5)
- Multi-way selection with Function Pointers
- Special cases
- pointers to void
- pointer conversions
- the Null pointer
- reading and printing integers
- Multi-dimensional Arrays
- declaration and naming convention
- initialization
- explicit
- implicit
26Complex Data Types Pointers and Arrays (4 of 5)
- manual vs. iteration
- processing, parsing, update
- boundary checking
- possible mistakes
- More about Identifiers and Objects
- Name Spaces
- Scope and Visibility of Identifiers
27Complex Data Types Pointers and Arrays (5 of 5)
- Storage type
- automatic
- volatile
- static
- register
- File level vs. Block level
- separate compilation
28Strings Processing (1 of 5)
- Strings
- Pointer arithmetic
- string vs. array
- null terminator
- declaration and naming convention
- initialization
- explicit
- implicit
- manual vs. iteration
- processing, parsing, update
- boundary checking
29Strings Processing (2 of 5)
- Functions for Strings Processing
- strcpy
- strlen
- strcmp
- I/O of Characters and Strings
- scanset specifiers
- printset specifiers
- I/O for arbitrary streams
- strings vs. streams
- stdin and stdout
30Strings Processing (3 of 5)
- Functions for Character (I/O) Processing
- string.h library
- getchar
- putchar
- getc
- putc
- fgetc
- fputc
31Strings Processing (4 of 5)
- Return errors for printf and scanf
- EOF
- ctype.h library
- Functions for Strings (I/O) Processing
- gets
- puts
- fgets
- fputs
32Strings Processing (5 of 5)
- Dynamic Memory Management
- malloc
- calloc
- realloc
- free
- Sorting Algorithms and Strings
- qsort
- bubble sort
- Function Macros
- declaration and naming convention
- definition and implementation
33Advanced Data Types (2 of 2)
- Structures
- why and how
- declaration and naming convention
- referring to individual elements
- examples complex numbers definition and
operations - arrays and pointers
- searching algorithms
- information retrieval
- linked lists
- binary trees
- balancing trees
34Advanced Data Types (2 of 2)
- Unions
- why and how
- declaration and naming convention
- referring to individual elements
- examples
- Bitfields
- why and how
- declaration and naming convention
- referring to individual elements
- operations for bit manipulation
- bitwise logical operators
- shift operators
- examples
35Fundamental File Processing (1 of 3)
- Steams and Files
- Files
- organization
- layout
- access
- buffering
- processing
- Streams
- buffering
- flushing
- file-position indicator
- end-of-file indicator
36Fundamental File Processing (2 of 3)
- Handlers
- C File Processing
- declaration
- opening type
- closing
- Binary files
- declaration
- opening
- read and write
- Direct Access
- declaration
- opening
37Fundamental File Processing (3 of 3)
- read and write
- controlling buffers
- Error handling
- Read from and write to Strings
- Special Functions
- varying number of arguments
- program parameters
- More on Pre-Processor Directives
- Conditional
38Appendices
- Keywords
- Operator Precedence and Associativity
- MS-DOS Memory Models and low-level programming