As I understand it, when we define a variable in C++ without initializing it, the variable is default initialized. The value it is given depends on where it is defined (such as within a function body or outside it, within the class defined by the standard library, or within the built-in type defined by the language itself).
On page 41 of C++ Primer 5th edition the topic "Variable Definitions" is introduced to its readers. It says that to define a variable we must provide a type specifier (which, as the name says, specifies a type), provide a name to the object (or variable) and separate it with commas, and finally end it with a semi-colon. Note that programmers distinguish between named and unnamed objects with the former being called a variable.
The variable gives named storage which the program manipulates as data. The type of an object, as mentioned before, tells us what the data mean and what operations can be performed on the data. The std namespace allows us to avoid inadvertent collisions between names we define and names defined in the standard library. All the names defined in the standard library are given the std namespace, such as std:tring, std::cout, std::cin and std::err.
My Question: what does a compiler do to this data besides run a program sequentially by first calling a function, and what does that look like?
On page 41 of C++ Primer 5th edition the topic "Variable Definitions" is introduced to its readers. It says that to define a variable we must provide a type specifier (which, as the name says, specifies a type), provide a name to the object (or variable) and separate it with commas, and finally end it with a semi-colon. Note that programmers distinguish between named and unnamed objects with the former being called a variable.
The variable gives named storage which the program manipulates as data. The type of an object, as mentioned before, tells us what the data mean and what operations can be performed on the data. The std namespace allows us to avoid inadvertent collisions between names we define and names defined in the standard library. All the names defined in the standard library are given the std namespace, such as std:tring, std::cout, std::cin and std::err.
My Question: what does a compiler do to this data besides run a program sequentially by first calling a function, and what does that look like?