chapter 1

Cards (20)

  • Programming
    Computers performing tasks by following a series of predefined instructions that conform to what we call a program
  • Programmer/Coder
    Person in charge of generating programs so that the computers may perform new tasks
  • Programming language
    A set of instructions that order computers on what to do
  • Programming language level
    • Determines how near to the hardware the programming language is
    • Lower level languages have instructions written thinking directly on interfacing with hardware
    • Higher level languages have more abstract or conceptual code
  • Higher level code is more portable, meaning it can work in more different machines with a smaller number of modifications
  • Lower level language is limited by the peculiarities of the hardware which it was written for
  • Programming language level choice
    • Hardware driver program - very low level
    • Big applications - usually higher level or combination of low and high level
  • C++
    • Can interact directly with the hardware almost with no limitations
    • Can work like one of the most powerful high level languages
  • C++ characteristics
    • Portability
    • Brevity
    • Object-oriented programming
    • Modular programming
    • C Compatibility
    • Speed
  • Many computer languages had come into existence, each meant for a specific purpose
    1960s
  • Development of programming languages

    1. ALGOL 60 - too abstract and general(Developed by International Commitee)
    2. CPL - Combined programming language; too big with too many features, hard to learn and implement ( Developed at Cambridge)
    3. BCPL -Basic Combined Programming Language; less powerful and too specific (Martin Richards at cambri )
    4. B - too specific (Ken Thompson at AT & T’s Bell Labs)
    5. C - inherited features of B and CPL, added some new features (Dennis Ritchie)
  • C++

    Evolved from C, extended with features to facilitate object oriented programming, created by Bjarne Stroustrup at AT&T
  • Structure of a simple C++ program
    1. Source code
    2. Output
  • // my first program in C++ - This is a comment line
  • #include <iostream.h> - Directive for the preprocessor to include the iostream standard file
  • main() function
    The point by where all C++ programs start their execution, contains the instructions to be executed first
  • cout << "Hello World";

    Inserts a sequence of characters into the standard output stream (usually the screen)
  • return 0;
    Causes the main function to finish, return code of 0 indicates the program worked as expected without errors
  • Compiling a C++ program
    1. Edit Source Code
    2. Compile
    3. Link
    4. Run Program
  • If the code compiles successfully, an object file is created. The object file is then linked to other object files and libraries required to create the executable.