Introduction to C Programming
Overview
C is a general-purpose programming language known for its efficiency, flexibility, and close interaction with computer hardware. Originally designed by Dennis Ritchie in 1972 at Bell Labs, USA, C has become a fundamental component of modern computing, powering everything from embedded systems and operating systems to high-performance applications.
Advantages and Disadvantages
Advantages of C Language | Disadvantages of C Language |
---|---|
- Exceptional performance and efficiency | - Lack of object-oriented features |
- Widespread compatibility and portability | - Limited support for avoiding namespace collisions |
- Low-level access and close proximity to hardware | - No garbage collector |
- Ideal for developing operating systems | - Limited support for polymorphism |
- Efficient memory management and speed | - Limited support for exceptions |
Program Structure
A program is a set of logically grouped instructions that are executed sequentially.
Compilation Process
High-Level Code -> Compiler -> Assembly -> Assembler -> Machine Code (input/output)
Software
Software is a collection of programs categorized into:
- Application Software: Programs designed according to specific needs/utilities (e.g., Games, Antivirus, MS Office).
- System Software: Essential for proper computer functioning (e.g., Operating Systems, Linkers, Loaders).
Software Portability
C is hardware portable but not software portable.
Compilation Steps
- Source Code (.c): Written in C programming language.
- Object Code: Generated by the compiler.
- Linking: Object code linked with libraries by the linker (system software).
- Executable File: Ready for execution.
- Loading: Executable file loaded from hard disk to RAM by the loader.