Next
Basics C and C++ >| |
About the C programming language
C is a general programming language that is used for a wide range of applications from operating systems such as Windows and iOS for software that is used to create 3D movies.
C programming is very efficient. This is the main reason why he is very popular despite having more than 40 years. Standard C programs are portable. A source code written in one system runs in another operating system without any change. As said, it is a good language to start learning a program.
C programming is very efficient. This is the main reason why he is very popular despite having more than 40 years. Standard C programs are portable. A source code written in one system runs in another operating system without any change. As said, it is a good language to start learning a program.
C is a general goal, a high-level language originally developed by Dennis M. Ritchie for the development of the UNIX operating system in Bell Labs. C was originally first deployed on the DEC PDP-11 computer in 1972.
Why using C?
C was initially used to work on system development, especially for programs that make up the operating system. C is adopted as a language for system development because it produces a code that runs almost faster than the code written in the assembler. Some examples of using C can be
- Operating systems
- Program translators
- Asemblers
- Text editors
- Network drivers
- Contemporary programs
- Data bases
About the C++ programming language
C++ is a high-level, general-purpose programming language. It can be used to develop desktop applications, operating systems, web browsers, games, graphical user interfaces, device drivers, embedded systems, client-server applications, etc.
It is compatible with the C language, in fact it is an extension of it, so it supports procedural and functional programming, but also object-oriented programming.
It was developed as an intermediate level language by Bjarne Stroustrup in 1979 at Bell Laboratories and is one of the most popular programming languages.
It has been updated several times so that the following versions can be found: C++98, C++11 (2011), C++14, C++17.
It can work on multiple platforms: windows, linux, Mac, etc.
It is compatible with the C language, in fact it is an extension of it, so it supports procedural and functional programming, but also object-oriented programming.
It was developed as an intermediate level language by Bjarne Stroustrup in 1979 at Bell Laboratories and is one of the most popular programming languages.
It has been updated several times so that the following versions can be found: C++98, C++11 (2011), C++14, C++17.
It can work on multiple platforms: windows, linux, Mac, etc.
This tutorial will explain the basics needed to create both simple and competitive tasks using the most popular algorithms: e.g. string sorting, binary search, Euclidean algorithm, etc.
The tutorial will also explain numerous examples created in both C and C++ variants of writing code. CodeBlock will be used as the development environment.
Given that every C program is also a C++ program, while the reverse is not true, i.e. not every C++ program is a C program, most solutions will be solved using the C++ variant in CodeBlock.
The tutorial will also explain numerous examples created in both C and C++ variants of writing code. CodeBlock will be used as the development environment.
Given that every C program is also a C++ program, while the reverse is not true, i.e. not every C++ program is a C program, most solutions will be solved using the C++ variant in CodeBlock.
What is needed to create a C or C++ program?
In addition to the operating system, in order to be able to develop a C, as well as a C++ application, you need:
A development tool for programming (optional), such as: dec c++, CodeBlock, VS Code, etc.
For the purposes of this tutorial, CodeBlock will be used, which can be downloaded from the website: https://www.codeblocks.org/downloads/
- Use a text editor to write the source code of the application. It can be notepad, notepad++ or another, or the editor included in the development tool, if it is used.
- Install the appropriate compiler. Most often it is the GNU C/C++ compiler. On Windows OS it is necessary to install MinGW (www.mingw.org), which contains the mentioned compiler, while on Linux OS the mentioned compiler can be installed with the command: $ g++ -v.
- The compiler converts the original version of the code, written in a text editor or an editor of a development environment (CodeBlock, for example) into an executable version of the code.
A development tool for programming (optional), such as: dec c++, CodeBlock, VS Code, etc.
For the purposes of this tutorial, CodeBlock will be used, which can be downloaded from the website: https://www.codeblocks.org/downloads/