Variable and fundamental types

data-structure

(UCM ELP) #1

variables
-Data held in memory.
-Data that is accessed by a name.
-You can change value.
-Variables must be declared by a type (int, double, etc)
-Should not be used until it has been given a value.
foto1

Fundamental data types
-Each data of a particular type.
-Each type establishes the set (interval) of valid values.
int
whole number (no decimals) 1363, -12, 49

float
Real numbers 12.45, -3.1932, 1.16E + 02

double
real numbers (greater range and accuracy)

char
characters ‘A’, ‘{’, '\ t’

bool
logical values ​​(true / false) true, false

string
Strings (string library) "Hello World!"

void
Nothing, absence type, absence of data (functions)

Automatic
-Perhaps you find yourself asking what happens when we write numerical expressions in which the operands are not all the same type.
-In these cases, when the operands of each operation associated with a binary operator are the same type, the compiler compiler makes a type in common.

Foundry
-Basically force the type of a variable because these must have the result of an operation is stored in a variable that has to be whether or if a particular type.

¿How to take input in C ++?
-Data input from keyboard is done through the use cin >> operator also called extractor.
-Transforms data entered characters.
-The entry ends with intro.

Steps compile C ++ program
-They can be done in two ways we will name two.
Method 1 Using GCC Unix
1.Open the terminal window on your Unix system.
2.Write gcc --version and press Enter. This command will show the version number of the C compiler …
3.Go to the folder where the source code is saved …
4.Main.c gcc -o writes HolaMundo …
5.Run the program you just compiled.
foto2
Method 2 Using Eclipse
1.Go to run this what does is compile and run your project.
2.The results are shown in the built-in eclipse console.
foto3