Basic C++ Survival Guide The following commands are typed at the UNIX prompt. UNIX is case-sensitive--all commands must be typed as written. The C++ compiler is gnu g++.
pico test.cpp  create a C++ source code file using pico editor
vi test.cpp    create a C++ source code file using vi editor
g++ test.cpp   preprocess, compile test.cpp to a.out
g++ -c test.cpp preprocess, compile 'test.cpp' to 'test.o'
g++ -o main test.cpp  preprocess, compile & link 'test.cpp' to 'main'
g++ -lm source.cpp link in math lib(must also include math.h)
man g++ view man pages for C++ compiler
g++ -c test.cpp 2>err  compile 'test.cpp' and redirect errors to 'err'
g++ -gall test.cpp  compile 'test.cpp' with full debugging on

CTRL-C  abort a running program 
CTRL-D  EOF character

Keywords
auto
break
case
catch
char
class
const
continue
delete

default
do
double
else
enum
extern
float
for
friend

goto
if
inline
int
long
new
overload
private
protected

public
register
return
short
signed
sizeof
static
struct
switch

this
template
typedef
union
unsigned
virtual
void
volatile
while

OPERATORS 

I/O manipulators (iomanip.h)  

setfill(ch)  Set the fill character to ch 
setw(n)  Set the field width to n  
setprecision(n)  set the floating-point precision to n places
setiosflags(flags)  Set the format flags
dec  Set output for decimal display
oct  Set output for octal display  
endl  Insert newline and flush stream
flush  Flush an ostream 


Flags for setiosflags()

ios::showpoint  Always show the decimal point (default: 6 places)
ios::showpos  Display a leading + sign when the number is positive
ios::fixed  Display up to 3 digits with 2 after decimal point. 
            Larger values revert to exponential notation  

ios::scientific  Use exponential display on output 
ios::showbase  Show base indicator on output  
ios::dec  Display in decimal format
ios::oct  Display in octal format  
ios::hex  Display in hexadecimal format  
ios::left  Left-Justify output  
ios::right  Right-Justify output  
ios::stdio  Flush stdout and stderr after insertion  
ios::skipws  Skip whitespace on input  

Note:These flags may be combined by OR operators; e.g. 
setiosflags(ios::showpoint | ios::left) sets the showpoint and left flags 
together.