0% found this document useful (0 votes)
32 views1 page

C++ Reference Chart

This document provides an overview of key C++ concepts including data types, operators, conditional statements, and loops. It defines common data types like int, char, float, and boolean types. It also summarizes common operators for arithmetic, assignment, comparison, logic, and increment/decrement. Control structures like if/else statements, while loops, do-while loops, and the conditional operator are described along with examples. Web resources for learning more about C++ are also listed.

Uploaded by

Misolovo123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views1 page

C++ Reference Chart

This document provides an overview of key C++ concepts including data types, operators, conditional statements, and loops. It defines common data types like int, char, float, and boolean types. It also summarizes common operators for arithmetic, assignment, comparison, logic, and increment/decrement. Control structures like if/else statements, while loops, do-while loops, and the conditional operator are described along with examples. Web resources for learning more about C++ are also listed.

Uploaded by

Misolovo123
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

c++ Quick Reference

c++ Data Types


Data Type char unsigned char
Description
CbanK::ter

Commonly Used Operators As signment Operators


=

Unsigned Character Integer int Short integer short int short Same as short int unsigned short int Unsigned shon integer unsigned short Same as unsigned short int unsigned int Unsigned integer unsigned Same as unsigned int long i nt Long integer Same as long int long unsigned long int Unsigned long integer Sarneas unsigned long int unsigned long float Single precision floating point double precision floating point double long double Long double precision floating point

+..
- ". *'"

1''''

Arithmetic Operators
+
..

Assignment Combined addition/assignment Combined su btraction/assignment Combined multiplication/assignment Combined di vision/assignment Combined modulus/assignment

1
%

Addition Subtraction Multiplication Division Modulus (remainder) Less than Less than or equal to Greater than Greater Ihall or equal 10 Equal to Not equal to AND

Relational Operators
<

<> >'" -!;Ii Ii

Logical Operators

II
I

OR
NOT

Increment/Decrement

Forms of the 1f Statement Simple if i f (expression) statement;


if/else i f ( expression)

++

Example
i f (x < y) x++;

lncrement Decrement

Example
i f (x < y)

Form:

Conditional Operator 7:

,statement;
else

x++;
else

expression ? expression ; expression Example:


x '" a < b ? a : b;
g '"

The sratement above works like:


if(3<b)

statement;
if/el se if
i f (expression)

x--;
Example
i f (x < y)

a;

e18e

x - b;

statement;
else i f (expression)

statement;
else

statement;

x++; else i f (x < z) x--; else y++;

The wbile Loop Form:


while (expression) statement; while (expression) {

Example:
while (x < 100)

cout

xo4o+

end1 ;

To conditionally-execute more than one statement, enclose the statements in braces: Form Example if (expression) i f (x < y)
( (

while (x < 100)


(

.9tatement;
statement;

cout X++i
)

endl;

statement; statement;

x++; cout
)

x,

The do-wbile Loop Form:


do

Example:
do

Web Sites
For tbe Sf1lrting Out with C++ Series aw.com/gaddisbooks For Addison-Wesley Computing
aw.com/computing

while (expres sion):


do
{

statement,

while (x < 100);

cout

x++

endl;

do {

statement; cout x end1; statement; x++ ; } while (expression) ; } while (x <: 100);

You might also like