Errors that happen when you execute your application are called runtime errors. You might have experienced the infamous "Access Violation" on older versions of Windows, which is a runtime error. Compile-time errors don't reach the end-user and are an indication of syntactical problems; they keep the programmer from generating an executable.
An interpreter is a tool that interprets what you code (or an intermediate
byte code) and performs certain actions.
A compiler is one that takes your code as an input and generates an object file. In the case of C++, after compiling and linking you have an executable that can run directly by the processor without need for any further interpretation.
A compiler takes a C++ code file as input and generates an object file in machine language. Often your code has dependencies on libraries and functions in other code files. Creating these links and generating an executable that integrates all dependencies directly and indirectly coded by you is the job of the linker.
Code. Compile to create object file. Link to create executable. Execute to test. Debug. Fix errors in code and repeat the steps. In many cases, compilation and linking is one step.
To supply options that allow the user to alter the behavior of a program. For example, the command ls in Linux or dir in Windows enables you to see the contents within the current directory or folder. To view files in another directory, you specify the path of the same using command-line arguments, as in ls / or dir \..
Code in C++ is case sensitive. Int is not acceptable to the compiler as an integer type int.
Global variables can be read and assigned globally. The latter is the problem as they can be changed globally. Assume you are working on a project with a few other programmers in a team. You have declared your integers and other variables to be global. If any programmer in your team changes the value of your integer inadvertently in his code-which even might be a different .CPP file than the one you are using-the reliability of your code is affected. So, sparing a few seconds or minutes should not be criteria, and you should not use global variables indiscriminately to ensure the stability of your code.
You would use cin.getline().
If you don't initialize, you don't know what the variable contains for a starting
value. The starting value is just the contents of the location in the memory that are
reserved for the variable. Initialization such as that seen here:
int myFavoriteNumber = 0;
writes the initial value of your choosing, in this case 0, to the memory location reserved for the variable myFavoriteNumber as soon as it is created. There are situations where you do conditional processing depending on the value of a variable (often checked against nonzero).
Such logic does not work reliably without initialization because an unassigned or initiated variable contains junk that is often nonzero and random.
C++ is a programming language that is used to program for a variety of applications, many running on devices with little computing capacity or memory resources. The simple old cell phone is one example where processing capacity
and available memory are both limited.
In this case, the programmer can often save memory or speed or both by choosing the right kind of variable if he doesn't need high values. If you are programming on a regular desktop or a high-end smartphone, chances are that the performance gained or memory saved in choosing one integer type over another is going to be insignificant and in some cases even absent.