programming in C + + in Ubuntu Linux (1) Well I'm using Kubuntu 8.04 with KDE 4. but it handles the same packages as Ubuntu.
To begin programming in C + + we must prepare our systems, since default is not the tools (IDEs and compilers) required.
What is a compiler? A compiler is a computer program that translates a program written in a programming language to another programming language, generating an equivalent program that the machine will be able to interpret. Usually second language is machine code, but can be just text. This translation process is called compilation.
A compiler is a program that allows you to translate the source code of a program in high level language to another lower-level language (usually machine language). In this way a developer can design a program in a language much closer to how you think a human being, and then compile it to a more manageable by a computer.
What is an IDE? An integrated development environment or in English Integrated Development Environment ("IDE") is a program consisting of a set of tools for programmers.
can devote himself exclusively to a single programming language or, to be used for several.
Dev C + +, an IDE for the programming language C + +.
Dev C + +, an IDE for the programming language C + +.
An IDE is a programming environment that has been packaged as an application program, ie, consists of a code editor, a compiler, debugger and a GUI builder.
The SDI provides a framework friendly to most programming languages \u200b\u200bsuch as C + +, Java, C #, Delphi, Visual Basic, etc. In some languages, an IDE can function as a run-time system, where you can use the programming language in an interactive way, without the need of work to text files such as Smalltalk or Objective-C.
What we need to start? We need to install the compiler for C + + for Linux would be g + + and gcc.
$ sudo apt-get install g + + gcc and even better
$ sudo apt-get install build-essential This is a virtual package where we will install everything you need to use our compiler (only Ubuntu, family and derivatives).
With this you can program in C + + in any text editor, I recommend the VI:
Example: # include
using namespace std;
int main ()
{
<< "Hello world!" ; court return 0;}
Save this code in a file or called holamundo.cpp
Compiling:
$ g + + holamundo.cpp-o hello
Running:
$. / hello
Result: Hello world!