Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
70 Cards in this Set
- Front
- Back
Every C++ program must have a...
|
Main function, which defines the prgram entry point.
|
|
Every C++ program must have a...
|
Main function, which defines the prgram entry point.
|
|
White space consists of blank lines and spaces, which are ignored by the...
|
Compiler, use white space to format your code in a more readable way.
|
|
In C++, zero is considered false and any non-zero value, negative or posotive is considered...
|
To be true.
|
|
C++ prgrams start executing at MAIN. Consequently, every C++ prgram must have...
|
A main function.
|
|
In C++, the curly braces are used to define..
|
The beggining and the end of a logical code unit.
|
|
C++ contains five binary arithmetic operators:
|
addition, subtraction, multiplication, division and modulus.
|
|
C++ supports several different kinds of numerical variable types, can we convert a type to another? For example, can we assign INT to be a FLOAT and or vice versa?
|
In general yes, we can convert from one built in numerical type to another implicitily (compiler converys automatically) or explicitily (we force a converstion in code manually).
|
|
An operand is the.....
|
Object of mathematical operation, a quanity or which an operation is performed.
|
|
Variable definition:
|
A variable corresponds to a physical segment of system memory (RAM) where value can be stored of some type. Via the variable nam we can access the memory cell the variable corresponds with.
|
|
Spaces inside a string are..
|
Not ignored, as they are actually considered space characters. Additonally, C++ keywords cannot simply be broken up and expected to mean the same thing (i.e. you cannot write "firstname" as "fir st nam e"`
|
|
By using the '/*'....*/ style comment, you can comment out parts of a...
|
line, whereas '//' comments always comment the entire line. For example.
cout << "Hello. " << /* print first name */ |
|
A single line comment is designated in C++ with...
|
The double forward slashes //
|
|
A multi line comment, where everything between a...
|
/* .... */ pair is part of the comment.
|
|
iostream and strings are C++ standard library header files. which...
|
Contains C++ standard library code.
|
|
#include <string>
|
Instructs the compiler ti takea ll the colde in "sting" an include it into our .CPP file.
|
|
#include <iostream>
|
Instructs the compiler to take all the code in the specified file (the file in between the angle brackets). "iostream", and include it into the .CPP file.
|
|
While usingspace x clause, you can...
|
Move code in some particular namespace to the global namespace, where x is some namespace.
|
|
Multiplacation, division and modulation operations always occure..
|
Before addition and subtraction operators.
|
|
The std: prefix tells the compiler to...
|
Search the standard namespace (folder) to look for the standard code we need.
|
|
It is good practice to try and avoid type..
|
conversions when practical.
|
|
Namespaces are used to...
|
Organize code into logical grouping and to prevent name clashes.
|
|
Namespaces are to code as folders are to files, that is to say....
|
As folder are used to organize groups of related files and prevent file name clashes, namespaces are used to organize groups of related code and prevent code name clashes.
|
|
Bool
|
Used to store truth values; that is, true or false. Note that true and false are C++ keywords.
|
|
Include directive
|
(#includefile)
|
|
A variable occupies a reigon of physical system memory and stores a...
|
Value of some type, variable names can consist of letters and numbers, but cannot begin with a number.
|
|
Cont variables are..
|
Variables that cannot be modified.
|
|
The modulus operator returns the remainder of a integer....
|
23 = 3 + 2
____ ____ 7 7 Here we call the numerator 2 in 2/7 the remainder |
|
Integer
|
An integer is a number that is written without a fractional component.
21, 4 and -2048 |
|
Only integer types can be unsigned, by using unsigned types we have not...
|
Gained a large range, we have merely transformed our range.
|
|
Prefixing the integer type with a...
|
Unsigned keyword makes it possible to take the memory reserved for representing negative numbers and use it to represent additional posotive number so that our range of posotive value increases.
|
|
It is possible to take all the memory reserved for representing negative numbers and use it to....
|
Represent additonal posotive numbers so that our range of posotive values increases. This would be at the cost of sacfificing the ability to represent negative integer.
|
|
Double range
|
+ 22 x 10 -308, 1.8 x 10 308
|
|
Float range
|
+ 1.2 x 10 -38 , 3.4 x 10 38
|
|
Int range and long range
|
- 2147483648, 2147483647
|
|
Use parentheses to..
|
Explicitiliy define the order in which the operators should be performed, consequently, this also makes your code cleaner.
|
|
Parentheses can also be nested so that you can...
|
Explicitily specify the second, thierd, etc. Operation that should occur.
|
|
Sometimes we will want to define a variable that cannot change, such variables are constant, to do this we use...
|
The const modifying keyword:
const float pi = 3.14p If the programmer tries to change pi, an error will reslut pi = 12.53f; //error, cannot redefine constant pi |
|
Const variables must be initialized as the....
|
Some time they are declared.
|
|
Short range
|
-32768, 32767
|
|
The terminology for something that evaluates to a number is called a....
|
Numeric expression, more generally, something that evaluates to something else is considered an expression.
|
|
The assingment operator "=" assigns value to variables, it says nothing about....
|
Equality in a purely comparative sense.
|
|
Char range
|
-128, 127
|
|
Float
|
Used to store floating point numbers: that is, numbers with greater precision than float.
|
|
C++ can implicitily convert between its intrnsic types; however, one must...
|
Be alert for decimal transaction and integer wrapping.
|
|
Create a symbol name (identifier) that stands for some set of code. We can do this by...
|
defines a macro
#define PRINTHELLO cout << "Hello" << endl; |
|
The modulus operator is an...
|
Integer operation only.
|
|
Note that operators with the same procedure level are...
|
Evaluated left to right.
|
|
Double
|
Similar to a float but typically stores floating points numbers with great precison than float.
|
|
Variable names can include the underscore, letters and numbers but....
|
No other symbols.
|
|
The rules of operator procedure define...
|
The order in which the compiler performs a series of operators.
|
|
Variables names cannot be C++ keywords, for instance you cannot name a....
|
Variable "float" since that is a C++ keyword that specifies the C++ type float.
|
|
Variable names must begin with...
|
A letter. The variable name 2VarName is illegal. However the underscore is considered a letter.
|
|
Underscore is considered a letter ans C++ is case...
|
Sensitive
|
|
When we declare/define a variable we must give it a...
|
Name (identifier) so that we can refer to that variable within the program.
|
|
When using the postfix form, the value is..
|
Incremented/decremented last, after it is used.
|
|
You can give greatest precedence to an operation by...
|
Surrounding it with a pair of parentheses much like you do in mathematical notation.
|
|
It is possible to make multiple declerations and/or definitions in one statement using...
|
The comma operator.
|
|
Variables names cannot have...
|
Spaces between them.
|
|
Long
|
A signed integer type that typically can store a longer range of integers than int.
|
|
Short
|
Typically stores a shorter range of integers than int.
|
|
Because variables that contain garbage are useless and to prone to introducing errors, it is advisable to...
|
Always define your variables at the time of decleration to some default value.
|
|
The "=" symbol, in C++ is called the...
|
Assingment operator.
|
|
Truncate
|
Shorten (something) by cutting of the top or the end.
|
|
A decimal portion of an answer will be lost because...
|
Integers are being used, and they are unable to repessent decimals. Keep this trunctuation in mind when doing division with integers and ask yourself whether or not this is a problem for your particular circumstances.
|
|
Declaring a variable...
|
Int myVar; // variable decleration
|
|
Int
|
The primary type used to store an integer value.
|
|
A C++ compiler translates code to object code. The linker then combines the object code, from several objects files to produce...
|
An executable program that can be run on the operating system.
|
|
Char
|
Used to store single character variables such as "a,b,c,d". Usually this is an 8 bit value so that it can store up to 256 values.
|
|
Std::string
|
Used to store string variables, std::string is not part of the core language. but part of the standard library.
|