An Over View of C Programming
An Over View of C Programming
programming
Raghu M E
Associate Professor
Department of CSE
Government Engineering College, Hassan
Contents
• Hard Disk
• Screen
• Disk Main Memory
• Printer
• CD-Rom/ DVD • Data and
• Plotter
instructions stored
• Tape Backup to, fetched from
Elements of a Computer System
Software
• Systems programs
• Control the computer
• Includes Operating System
• Applications programs
• Word processors
• Compilers
• Spreadsheets
• Data Bases
Need for Computer Languages
• Machine Level –
Binary Data ( 0’s and 1’s )
• Assembly Level –
Instructions (Need translators)-LDA, ADD, etc..
• High Level –
English like Statements (Need translators)
Processing a High-Level Language Program
• Character set
• Keywords
• Data types
• Constants
• Identifiers
• Variables
• Strings
Cont.…
• Types of symbols
• Read/write statements
• Conditional / control statements
• Arrays
• Strings
• Functions
• Structures / Unions
• Pointers
• Files
• Memory allocation
Cont.…
C programme structure
/*documentation*/
main( )
{
Body
}
Cont.…
{
Declarations;
Statements;
}
Cont.…
• Entry controlled
• Exit controlled
Arrays
• Array: sequence of identical objects in memory
• int a[10]; means space for ten integers
• By itself, a is the address of the first integer
• *a and a[0] mean the same thing
• The address of a is not stored in memory: the compiler inserts code to
compute it when it appears
Multidimensional Arrays
• Collection of records.
• Binary and text files.
• File pointer.
• File open, close.
• Read, write, append modes.
Memory allocation