0136022537StartingC.pdf
(
5094 KB
)
Pobierz
C++ Quick Reference
C++Data Types
Data Type Descr i p t i on
char
Character
unsigned char
Unsigned Character
int
Integer
short int
Short integer
short
Same as
short int
unsigned short int
Unsigned short integer
unsigned short
Same as
unsigned short int
unsigned int
Unsigned integer
unsigned
Same as
unsigned int
long int
Long integer
long
Same as
long int
unsigned long int
Unsigned long integer
unsigned long
Commonly Used Operators
Ass i gnmen t Operator s
= A
ssignment
+=
Combined addition/assignment
-=
Combined subtraction/assignment
*=
Combined multiplication/assignment
/=
Combined division/assignment
%=
Combined modulus/assignment
Ar i t hme t ic Operat or s
+
Addition
-
Subtraction
*
Multiplication
/
Division
%
Modulus (remainder)
Re la t i ona l Operator s
<
Less than
<=
Less than or equal to
>
Greater than
>=
Greater than or equal to
==
Equal to
!=
Not equal to
Log ical Operat or s
&&
AND
||
OR
!
NOT
Incremen t /Decremen t
++
Same as
unsigned long int
Single precision floating point
float
double precision floating point
double
Long double precision floating
point
long double
Increment
Forms of the
if
Statement
Simp le i f
Decrement
--
Examp le
if (expression)
if(x<y)
statement;
x++;
Conditional Operator ?:
Form:
expression ? expression : expression
Examp le :
x=a<b?a:b;
The statement above works
like:
if (a < b)
x=a;
else
x=b;
i f /e l se
Examp le
if (expression)
if(x<y)
statement;
x++;
else
else
statement;
x--;
i f /e l se i f
Examp le
if (expression)
if(x<y)
statement;
x++;
else if (expression)
else if (x < z)
The
while
Loop
Form:
statement;
x--;
Examp le :
while (expression)
while (x < 100)
else
else
statement;
cout << x++ << endl;
statement;
y++;
while (expression)
while (x < 100)
To conditionally-execute more than one
statement, enclose the statements in braces:
Form
{
{
statement;
cout << x << endl;
statement;
x++;
Examp le
}
}
if (expression)
if(x<y)
{
{
statement;
x++;
The do-
while
Loop
Form:
statement;
cout << x;
Examp le :
}
}
do
do
statement;
cout << x++ << endl;
while (expression);
while (x < 100);
Web Sites
For the StartingOutwithC++Series
aw.com/gaddisbooks
For Addison-Wesley Computing
aw.com/computing
do do
{ {
statement; cout << x << endl;
statement; x++;
} while (expression); } while (x < 100);
LOCATION OF VIDEONOTES IN THE TEXT
Chapter 1
Introduction to Flowcharting, p. 19
Designing a Program with Pseudocode, p. 19
Designing the Account Balance Program, p. 25
Predicting the Result of Problem 33, p. 25
Chapter 2
Using
cout
, p. 31
Variable Definitions, p. 37
Assignment Statements and Simple Math Expressions, p. 59
Solving the Restaurant Bill problem, p. 75
Chapter 3
Reading Input with
cin
, p. 79
Formatting Numbers with
setprecision
, p. 115
Writing Data to a File, p. 140
Reading Data from a File, p. 141
Solving the Stadium Seating Problem, p. 152
Chapter 4
The
if
Statement, p. 164
The
if/else
Statement, p. 177
The
if/else
if
Statement, p. 187
Solving the Time Calculator Problem, p. 235
Chapter 5
The
while
Loop, p. 246
The
for
Loop, p. 262
Solving the Calories Burned Problem, p. 291
Chapter 6
Functions and Arguments, p. 309
Value-Returning Functions, p. 322
Solving the Markup Problem, p. 365
Chapter 7
Accessing Array Elements with a Loop, p. 378
Passing an Array to a Function, p. 401
Solving the Chips and Salsa Problem, p. 443
Chapter 8
The Binary Search, p. 454
The Selection Sort, p. 469
Solving the Charge Account Validation Modification Problem, p. 487
Chapter 9
Dynamically Allocating an Array, p. 519
Solving the
getString
Function Problem, p. 538
Chapter 10
Writing a C-String-Handling Function, p. 564
Using the
string
Class, p. 570
Solving the Backward String Problem, p. 584
(continued on next page)
LOCATION OF VIDEONOTES IN THE TEXT
(continued)
Chapter 11
Creating a Structure, p. 591
Passing a Structure to a Function, p. 610
Solving the Weather Statistics Problem, p. 644
Chapter 12
Passing File Stream Objects to Functions, p. 661
Working with Multiple Files, p. 673
Solving the File Encryption Filter Problem, p. 703
Chapter 13
Writing a Class, p. 712
Defining an Instance of a Class, p. 717
Solving the
Employee
Class Problem, p. 792
Chapter 14
Operator Overloading, p. 819
Class Aggregation, p. 848
Solving the
NumDays
Problem, p. 864
Chapter 15
Redefining a Base Class Function in a Derived Class, p. 893
Polymorphism, p. 903
Solving the
Employee
and
ProductionWorker
Classes Problem, p. 936
From Control Structures
through Objects
6th Edition Brief Version
Tony Gaddis
Plik z chomika:
Iskraa
Inne pliki z tego folderu:
John.Wiley.and.Sons.XML.in.60.Minutes.a.Day.eBook-DDU.pdf
(96357 KB)
Introducing Mudbox - Kermanikian - Wiley (2010).pdf
(33578 KB)
Sybex.MCSE.Windows.Server.2003.Network.Security.Design.Study.Guide.70.298.May.2004.eBook-DDU.chm
(14403 KB)
John.Wiley.And.Sons.Windows.Server.2003.For.Dummies.chm
(10227 KB)
Addison.Wesley.Moving.To.Linux.Kiss.The.Blue.Screen.Of.Death.Goodbye.eBook-LiB.chm
(5479 KB)
Inne foldery tego chomika:
!3d programing
!Agile - Best Practices
!AI
!AJAX
!algorytmika
Zgłoś jeśli
naruszono regulamin