Skip to content

Latest commit

 

History

History

README.md

C++ Basic Concepts

C++ is a popular cross-platform language that can be used to create high-performance applications - operating systems, browsers, video-games, art applications and so on.

A C++ program is a collection of commands or statements.

Below is a simple program template.

#include <iostream>
using namespace std;

int main()
{

  return 0;
}

Hello World

#include <iostream>
using namespace std;

int main()
{
  cout << "Hello world!";
  cout << " This " << "is " << "awesome!";
  return 0;
}

Elements of a C++ program

Programming languages—like all other languages—have basic elements that are used as building blocks, as well as rules by which those elements are combined. These rules are called the syntax of the language.

Keywords

  • (start, end, if-then..., etc.),
  • identifiers (essentially variable names, procedures, functions, program name, etc.),
  • special characters (comma, apostrophe, etc.),
  • constants
  • variables
  • expressions
  • instructions

Basic elements

In addition to these basic elements, there are other elements that are part of the programs, whose understanding and operation will be vital for the correct design of an algorithm and naturally the coding of the program.

These elements are:

  • loops,
  • counters,
  • accumulators,
  • switches,
  • structures:
  • sequential
  • selective
  • repetitive

Data types

The primary goal of any computer is to handle information or data. This data can be sales figures in a supermarket or grades in a class. A piece of data is a general expression that describes the objects that a computer operates with. Most computers can work with several types (modes) of data. The corresponding algorithms and programs operate on these types of data.

In the problem-solving process, the design of the data structure is as important as the design of the algorithm and the program that is based on it.

In programming languages, data must be of a specific data type. The data type determines how the data is represented in the computer and the different processes that the computer performs with it.

REFERENCES

Websites

Books

  • Deitel, H. M. y Deitel, P. J. C++ Cómo programar. 2da. ed., Prentice Hall. México, 1999.

  • Bronson, Gary J. C++ para ingeniería y ciencias. International Thomson Editores. México, 2000.

  • Strouptrop, Bjarne. El lenguaje de programación C++. 3ra. ed., Addison Wesley. Madrid, 1998.

  • Joyanes A., L. Programación en C++. Algoritmos, estructuras de datos y objetos. McGraw Hill.

  • Rodríguez A. E. y Rodríguez C. I. Seudocódigo. Material Didáctico No. 5. Depto. de Matemáticas, Universidad de Sonora, 2002.