Types of variables

 Types of variables 

Integer: 

An integer, in the context of computer programming, is a data type used to represent real numbers that do not have fractional values. 

The use of integers as variables supports programming in various ways. For instance, a common strategy is to create an integer variable and store some value in it that will influence computations or calculations made within the program. 

Float: 

A float is a data type composed of a number that is not an integer, because it includes a fraction represented in decimal format. 

One of the most common definitions given from experts is that a float “has numbers on both sides of the decimal.” However, it may be simpler to say that the float includes decimal fractions, where the integer does not. 

Some point out that the float data type is used in computer programming when more precision is needed than what integers can provide. 

String: 

Most programming languages have a data type called a string, which is used for data values that are made up of ordered sequences of characters, such as "hello world". A string can contain any sequence of characters, visible or invisible, and characters may be repeated. The number of characters in the string is called its length, and "hello world" has length 11 - made up of 10 letters and 1 space. There is usually a restriction on the maximum length of a string. There is also such a thing as an empty string, which contains no characters - length 0. 

Boolean: 

Boolean Logic is a form of algebra which is centred around three simple words known as Boolean Operators: “Or,” “And,” and “Not”. The idea of Boolean is that all values are either true or false.  

The Boolean operator “OR” is used to express that if one of two or more conditions are, met the value of a specified query is true. 

As a Boolean operator, “AND” serves to indicate that ALL specified conditions must be met for a query to return true. 

If a client was building an audience and wanted to target only users who had shown an affinity for Sports Cars and Fishing and History, “AND” would be used. 

The “NOT” Boolean operator is used to exclude nodes from an audience definition. As it applies to the creation of an audience definition, “NOT” will exclude all users falling under the node which has been prepended by “NOT.” 

Vector: 

A vector, in programming, is a type of array that is one dimensional. Vectors are a logical element in programming languages that are used for storing data. Vectors are like arrays, but their actual implementation and operation differs. 

Vectors are primarily used within the programming context of most programming languages and serve as data structure containers. Being a data structure, vectors are used for storing objects and collections of objects in an organized structure. 

The major difference between and array and a vector is that, unlike typical arrays, the container size of a vector can be easily increased and decreased to complement different data storage types. Vectors can be thought of as dynamic arrays. 

Arrays: 

An array is a series of memory locations – or ‘boxes’ – each of which holds a single item of data, but with each box sharing the same name. All data in an array must be of the same data type. 

Structures: 

A Structure is one of the 5 data types in programming. A structure is used to represent information about something more complicated than a single number, character, or Boolean can do (and more complicated than an array of the above data types can do). For example, a student can be defined by his or her name, age, gpa etc. Each of these pieces of information should be labelled with an easily understood descriptive title, and then combined to form a whole (the structure). 

Comments