References, Pointers and Constants

From Yggenyk
Revision as of 07:19, 14 October 2008 by WikiSysop (talk | contribs) (New page: ==Simple C++ Data Types== {|width="100%" border="1" cellpadding="2" cellspacing="0" |- !style="color:#ffb900"|C++ Code !style="color:#ffb900"|What It Means !style="color:#ffb900"|When To ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Simple C++ Data Types

C++ Code What It Means When To Use It

char
int
double

Single (scalar) value (character, integer, floating point number)

To store data
To pass data to a function by value
To return data by value

const char
const int
const double

Constant value

To declare a constant -- a value that cannot be changed
Has no effect for passing values to a function or from returning values from a function

char []

int []
double []

Array (vector) of values
(char [] is a string)

To store the same type of data together
To pass an array to a function

id=siteTree