Friday 22 May 2015

Basics of C++ Programming

Before we start, let me give you some basic concepts.

What is a Computer?

A computer is an electronic device that can follow instructions to
  • Accept input (data)
  • Process that input
  • Produce output (information)
Data: is raw, unorganized facts that need to be processed. Data can be something simple and seemingly random and useless until it is organized. For example, each student's test score.

Information: When data is processed, organized, structured or presented in a given context so as to make it useful, it is called Information. For example, the class' average score or the school's average score.

A computer is an electronic device operating under the control of instructions (software) stored in its own memory unit, that can accept data (input), manipulate data (process), and produce information (output) from the processing.

Generally, the term is used to describe a collection of devices that function together as a system.

What does a Computer do?

Computers perform four general operations which make up the information cycle.
  • Input
  • Process
  • Output
  • Storage
information-processing-cycle

Devices that comprise a Computer System

computer-system

Introduction to C++ Programming

Computer Programming:
Computer-Programming
Computer Programs:
Computer-Programs

Programming Languages

Programmers write these instructions in different programming languages.
Programming-Languages

Machine Languages:
  • Strings of 0s and 1s
  • Directly understandable by computer
  • Defined by hardware of the machine
  • Hard for human beings to learn, error prone
  • Slow programming
Assembly Languages:
  • English like abbreviations
  • Not directly understandable by computer, hence require translator programs called "Assemblers"
  • Relatively easier for human beings to learn
  • Slightly faster programming
High Level Languages:
  • Developed for fast and speedy programming
  • Not directly understandable by computer, hence require translator programs called "Compilers"
  • Not dependent on hardware of the machine (mostly)
  • Easy to learn, less chances of error
  • Fast programming
Interpreters are another important category of translator programs.

Why C++?

C is a language designed by and for programmers. C++ is an expanded and enhanced version of C programming language. It is the language of choice for professional programmers worldwide. Once mastered, C++ will give you complete control over the computer. C++ is, above all, the most powerful programming language ever invented.

Compiler

Compiler

Basics of a typical C++ environment:
  • Program-development environment
  • Language
  • C++ standard library

The C++ Standard Library

C++ programs consist of pieces/modules called classes and functions. A programmer can create his own functions
  • Advantage: the programmer knows exactly how it works
  • Disadvantage: time consuming
Programmers will often use the C++ library functions as building blocks to avoid re-inventing the wheel
  • If a pre-made function exists, generally best to use it rather than write your own
  • Library functions are carefully written, efficient and portable
Phases of C++ programs
  1. Edit
  2. Preprocess
  3. Compile
  4. Link
  5. Load
  6. Execute
phases-of-c++-programs

Program Translation:
Program-Translation

About the Author

Editorial

Editorial Team

Post a Comment

 
Codexify © 2015 - Designed by Templateism.com