/cplect

C Programming Lecture PPT

Primary LanguageJavaScriptMIT LicenseMIT

C Programming

Prof. Shiburaj

Rizvi College of Engineering

Hello everyone,

These set of pages are the materials used by me for the delivery of the lectures in the course of C Programming.

Syllabus

  • Module 1
    • Introduction
      • Introduction to components of a Computer System
      • Introduction to Algorithm and Flowchart
    • Fundamentals of C Programming
      • Keywords, Identifiers, Constants and Variables
      • Data types in C
      • Operators in C
      • Basic Input and Output Operations
      • Expressions and Precedence of Operators
      • In-built Functions
  • Module 2
    • Control Structures
      • Introduction to Control Structures
    • Branching and looping structures
      • If statement, If-else statement, Nested if-else, else-if Ladder
      • Switch statement
      • For loop, While loop
  • Module 3
    • Functions
      • Introduction to functions
      • Function prototype, Function definition, Accessing a function and parameter passing.
      • Recursion.
  • Module 4
    • Arrays and Strings
      • Introduction to Arrays
      • Declaration and initialization of one dimensional and two-dimensional arrays.
      • Definition and initialization of String
      • String functions
  • Module 5
    • Structure and Union
      • Concept of Structure and Union
      • Declaration and Initialization of structure and union
      • Nested structures
      • Array of Structures
      • Passing structure to functions
  • Module 6
    • Pointers
      • Fundamentals of pointers
      • Declaration, initialization and dereferencing of pointers
      • Operations on Pointers
      • Concept of dynamic memory allocation

Scheme

Sections of a C Program

\\ Comments

\\ Preprocessor Directives

\\ Globals & Constants

\\ Main Function

\\ User defined Functions

C Compilers

IDE for C Programming

GCC Compiler Parameters

  • -o name = Set the name of the output file eg: -o test.exe
  • -E = Used to return the preprocessor output (.i extention)
  • -S = Used to return assembly code (.s extension)
  • -C = Used to create the object file (.o extension)
  • -save-temps = To generate all the intermediate files during compilation.
  • -ansi = To enable the ANSI standard
  • -std=c89|c99|c9x = To change the standard
  • -pedantic-errors = Strict conformance to ISO standards
  • -Wall = Show errors and warnings

Links

C Program Structure (Basic)

/*
    Aim: ...
    Author: ...
    Class: ...
*/

#include <stdio.h>

int main ()
{
    // Your code starts here


    return 0;
}

C Program Structure (Advanced)

/* Documentation */
/*
    Aim: ...
    Author: ...
    Class: ...
*/

/* Libraries */
#include <stdio.h>

/* Function Declarations */
int example(int x);

/* Global Variables & Constants */
int x = 100;
#define PI 3.142 

/* Main Function */
int main ()
{
    // Your code starts here


    return 0;
}

/* Function Definitions */
int example(int x){

}