C++ Lec-1 (Introduction to Programming Languages)

 

Introduction to Programming Languages

________________________________________________________________________

Programming languages are formal languages comprising a set of instructions that produce various kinds of output. They are used in computer programming to implement algorithms and control the behavior of machines.

Language Generation

Programming languages have evolved through several generations:

  1. First Generation (1GL): Machine language, the most basic level of programming languages, consisting of binary code.
  2. Second Generation (2GL): Assembly language, a low-level language with a strong correspondence to the machine language instructions.
  3. Third Generation (3GL): High-level languages like C, C++, Java, Python, which are more abstract and easier for humans to understand.
  4. Fourth Generation (4GL): Languages closer to human language, often used for database querying and report generation (e.g., SQL).
  5. Fifth Generation (5GL): Languages used for artificial intelligence and neural networks (e.g., Prolog).

History of C++

C++ is a general-purpose programming language created by Bjarne Stroustrup as an extension of the C programming language, incorporating object-oriented features. It was first released in 1985 and has since undergone several updates to include modern programming practices and paradigms.

Tools and Editors for C++ Programming

  1. IDEs (Integrated Development Environments):
    • Visual Studio: A comprehensive IDE from Microsoft.
    • CLion: A cross-platform IDE for C++ development from JetBrains.
    • Code::Blocks: An open-source, cross-platform IDE. And many more…
  2. Text Editors:
    • Visual Studio Code: A versatile and popular code editor.
    • Sublime Text: A sophisticated text editor for code, markup, and prose.
    • Notepad++: A free source code editor and Notepad replacement.  And many more…

 

 

Compilers

  • GCC (GNU Compiler Collection): A standard compiler for many Unix-like systems.
  • Clang: A compiler front end for the C, C++, and Objective-C programming languages.
  • Microsoft C++ (MSVC): The compiler provided with Microsoft Visual Studio.
  •  

Basics of Programming Fundamentals in C++

 1. Structure of a C++ Program

2. Comments

3. Data Types

4. Variables and Constants

5. Input and Output

6. Operators

7. Control Structures

  • If-else statements:
  • Switch statement:
  • Loops:
    • For loop:
    • While loop:
    • Do-while loop:

8. Functions

  • Function declaration:
  • Function definition:

9. Arrays

10. Pointers

11. Structure

12. Union

13. Enum

 

Flow of Code

  1. Preprocessing: Preprocessor directives (e.g., #include, #define) are resolved.
  2. Compilation: Source code is compiled into object code.
  3. Linking: Object code is linked with libraries to create an executable.
  4. Execution: The program is run, and the output is generated.

 

 References

  1. Books:
    • "The C++ Programming Language" by Bjarne Stroustrup
    • "Effective C++" by Scott Meyers
    • "C++ Primer" by Stanley B. Lippman, Josée Lajoie, and Barbara E. Moo
    • “Let us C and CPP” by Yashwant Kanitkar
    • Personally, I suggest : “C in Depth” by Shrivastava 
  1. Online Resources:
    • cplusplus.com
    • GeeksforGeeks C++ Programming Language
    • Codecademy C++ Course
    • W3School
  2. Compiler Documentation:
    • GCC Documentation
    • Clang Documentation

 

Comments

Popular posts from this blog

DATA TYPE in C/C++

Flow Charts - What Is a Flow Chart? When to Use a Flowchart? Flowchart Symbols & Components