Sei sulla pagina 1di 19

Programming in C

Introduction

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Why Learn C?
Skills translate smoothly to other languages

Many languages are based on C concepts and syntax

Its 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

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

What is C?
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

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

What is C?
Some languages related to C

C++
Objective C
Perl
TCL
Java
JavaScript
PHP
C#

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Compare C to Other Modern Languages

C++
Objective C
C#
Java

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Compare C to Other Modern Languages

C++
Objective C
C#
Java

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Compare C to Other Modern Languages

C++
Objective C
C#
Java

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Compare C to Other Modern Languages

C++
Objective C
C#
Java

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Compare C to Other Modern Languages

C++
Objective C
C#
Java

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

What is C?
C is a Compiled Language

Code must be converted to machine code to execute


Very speedy execution

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

What is C?

K&RC

First implementation of the language

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

Documented in 1978

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

C1X

Future C standard

Proposed in 2007

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Elements of C
Program flow

External imports

Read code file written in C or another language


Use already compiled code

Functions

Allows for code modularity


Maximizes reusability

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Elements of C
Data Types

Primitive

Basic data types

Composite

Data types that are made of other data types

Variables that maintain their value during program execution

Pointers

Ex: Structures

Static

Ex: Integer, Floating-point, Character, etc

Access to memory locations that data is stored

Arrays

Lists of elements

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Elements of C
Processing

Operators

Performs arithmetic or Boolean logical expressions

Comparisons

Allows different types of expressions to be evaluated to


dictate process flow

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

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

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Elements of C
Data Structures

Stacks

Queues

A set of integer constants

Structures (Structs)

Method of programming where elements that arrive first are used first

Enumerations (Enums)

Method of programming where elements that arrive last are used first

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

Unions

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

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Elements of C
Memory Allocation

Allocate

Reallocate

Designate dynamic memory


Reuse previously used memory for a new purpose

Free

Handing newly available space back over to the


operating system

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Our Working Environment


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

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Programming in C

Programming in C
The End
Thanks for watching!

Copyright BlueSignet LLC. All rights reserved. For more visit WiBit.Net

Potrebbero piacerti anche