Sams teach yourself C++ in 10 minutes : Includes index by Jesse Liberty; Safari Tech Books Online

By Jesse Liberty; Safari Tech Books Online

Show description

Read Online or Download Sams teach yourself C++ in 10 minutes : Includes index PDF

Best nonfiction_12 books

The Cambodian Version of the Ramayana

Released within the yr 2004, The Cambodian model of the Ramayana is a invaluable contribution to the sector of Asian reviews.

Extra resources for Sams teach yourself C++ in 10 minutes : Includes index

Example text

1: #include 2: 3: using namespace std; 4: 5: int main(int argc, char* argv[]) 6: { 7: cout << ((6/2)+3) << endl; *8: *9: // Note: You must type something before the Enter key *10: char StopCharacter; *11: cout << endl << “Press a key and \”Enter\”: “; *12: cin >> StopCharacter; *13: 14: return 0; 15:} ANALYSIS Lines 8–13 are new. Lines 8 and 13 are whitespace and line 9 is a comment. Lines 10 –12 are the ones that count. Line 10 declares a variable. This variable is a place to keep the single character that the user must type to end the pause.

Although these are technically variables, because they have names, the use of the word const on these variable declarations makes it clear to the compiler that the program is not allowed to change the content of these variables in any way (unlike, for instance, the variable StopCharacter, which stores whatever character the user types in). 14159). Line 10 declares a variable and assigns the result of part of an expression to the variable. It uses the names of the constants on lines 7 and 8 in the expression, so the value in Result depends on the content of those constants.

Floating-Point Variables Floating-point variables can have fractional values and decimal points, unlike integers. 1. This table shows the variable types, how much room they typically take in memory, and what ranges of values can be stored in these variables. 1. 4 times ten to the 38th power,” which is 340,000,000,000,000,000,000,000,000,000,000,000,000. 8e308 or false Strings String variables are a special case. They are called arrays and will be discussed in more detail later. Case Sensitivity C++ is case sensitive.

Download PDF sample

Rated 4.42 of 5 – based on 11 votes