Fundamentals of Programming with - PowerPoint PPT Presentation

About This Presentation
Title:

Fundamentals of Programming with

Description:

Fundamentals of Programming with C An overview of: General Computer Programming Concepts, Techniques and Tools Using C as an implementation computer ... – PowerPoint PPT presentation

Number of Views:429
Avg rating:3.0/5.0
Slides: 39
Provided by: Cliff217
Category:

less

Transcript and Presenter's Notes

Title: Fundamentals of Programming with


1
Fundamentals 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...

2
Programming 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

3
Programming 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

4
C 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

5
C 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

6
C 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

7
C 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

8
C 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

9
C 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

10
C 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

11
C 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

12
C Programming Language - The ABC (9 of 9)
  • return value
  • return
  • declaration
  • type
  • examples

13
Intermediate 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)

14
Intermediate C Programming Concepts (2 of 6)
  • Fundamental Statements
  • while statement
  • structure
  • initialization
  • condition
  • iteration
  • execution
  • special cases
  • nesting
  • do statement
  • structure
  • initialization

15
Intermediate C Programming Concepts (3 of 6)
  • condition
  • iteration
  • execution
  • special cases
  • nesting
  • for statement
  • structure
  • initialization
  • condition
  • iteration
  • execution
  • special cases
  • nesting

16
Intermediate 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

17
Intermediate 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

18
Intermediate 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

19
More 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

20
More 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

21
More 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

22
More 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

23
Complex 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

24
Complex 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

25
Complex 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

26
Complex 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

27
Complex Data Types Pointers and Arrays (5 of 5)
  • Storage type
  • automatic
  • volatile
  • static
  • register
  • File level vs. Block level
  • separate compilation

28
Strings 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

29
Strings 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

30
Strings Processing (3 of 5)
  • Functions for Character (I/O) Processing
  • string.h library
  • getchar
  • putchar
  • getc
  • putc
  • fgetc
  • fputc

31
Strings Processing (4 of 5)
  • Return errors for printf and scanf
  • EOF
  • ctype.h library
  • Functions for Strings (I/O) Processing
  • gets
  • puts
  • fgets
  • fputs

32
Strings 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

33
Advanced 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

34
Advanced 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

35
Fundamental File Processing (1 of 3)
  • Steams and Files
  • Files
  • organization
  • layout
  • access
  • buffering
  • processing
  • Streams
  • buffering
  • flushing
  • file-position indicator
  • end-of-file indicator

36
Fundamental File Processing (2 of 3)
  • Handlers
  • C File Processing
  • declaration
  • opening type
  • closing
  • Binary files
  • declaration
  • opening
  • read and write
  • Direct Access
  • declaration
  • opening

37
Fundamental 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

38
Appendices
  • Keywords
  • Operator Precedence and Associativity
  • MS-DOS Memory Models and low-level programming
Write a Comment
User Comments (0)
About PowerShow.com