You are on page 1of 19

Programming in C

Introduction

  • Skills translate smoothly to other languages

Many languages are based on C concepts and syntax

  • It’s been in wide spread use for decades

Lots of existing code is written in C

Chances of seeing C code in a software development

career is very high

  • Relatively low level

Learning C makes more advanced languages easier to understand

Starting at the Object Oriented (OO) level does not expose programmers to many aspects of programming

  • Programming language originally written for UNIX

  • Developed in the early 1970s by Bell Labs

  • Main focus was for System Software development

Operating Systems

Drivers

  • Designed to be portable

 Some languages related to C • C++ Objective C Perl TCL Java • JavaScript PHP
Some languages related to C
C++
Objective C
Perl
TCL
Java
• JavaScript
PHP
C#
  • C++

  • Objective C

  • C#

  • Java

 C++  Objective C  C#  Java
  • C++

  • Objective C

  • C#

  • Java

 C++  Objective C  C#  Java
 C++  Objective C  C#  Java
  • C++

  • Objective C

  • C#

  • Java

 C++  Objective C  C#  Java
 C++  Objective C  C#  Java
  • C++

  • Objective C

  • C#

  • Java

 C++  Objective C  C#  Java
 C++  Objective C  C#  Java
  • C++

  • Objective C

  • C#

  • Java

 C++  Objective C  C#  Java
 C++  Objective C  C#  Java
  • C is a “Compiled Language”

Code must be converted to machine code to execute

Very speedy execution

  • K & R C

 

First implementation of the language

Documented in 1978

  • ANSI C

Most common form of the language

Documented in 1983

Standardized version of the early C language

  • C99

 

Next C standard

Documented in 1995

Adds a few other additional functionalities to the language

Ex: Boolean data types, variable length arrays, better hardware usage

  • C1X

Future C standard

Proposed in 2007

  • Program flow

External imports

  • Read code file written in C or another language

  • Use already compiled code

Functions

  • Allows for code modularity

  • Maximizes reusability

  • Data Types

Primitive

 

Basic data types

 

Ex: Integer, Floating-point, Character, etc…

Composite

 

Data types that are made of other data types

 

Ex: Structures

Static

Variables that maintain their value during program execution

Pointers

 

Access to memory locations that data is stored

Arrays

 

Lists of elements

  • Processing

Operators

  • Performs arithmetic or Boolean logical expressions

Comparisons

  • Allows different types of expressions to be evaluated to dictate process flow

  • Control Structures

Decision Statements

  • Gives the program the ability to make choices based on

logical expressions

Loops

  • Traverse through iterations of a processes on a given or dynamic interval

  • Data Structures

Stacks

 

Method of programming where elements that arrive last are used first

Queues

 

Method of programming where elements that arrive first are used first

Enumerations (Enums)

A set of integer constants

Structures (Structs)

A set of variable values (Fields) that consist of different types

Unions

 

A set of variable values (Members) occupying the same storage space

  • Memory Allocation

Allocate

  • Designate dynamic memory

Reallocate

  • Reuse previously used memory for a new purpose

Free

  • Handing newly available space back over to the operating system

  • Technique

Minimalist

  • No IDE, simple text editor and compiler

  • Operating System

Microsoft Windows

  • Compiler

MinGW (Minimalist GNU for Windows)

  • Windows port of GNU GCC

  • Text Editor

Notepad++

Programming in C

The End

Thanks for watching!