CS151 -- Administration

Quiz 1

Project 2 -- Umm....

Midterm -- Reminder July 2

Syllabus updated

CS151 -- Shawn Stoffer









IOStreams

#include <iostream>

istream cin;
ostream cout, cerr;
CS151 -- Shawn Stoffer


 
 
 
 
 
 
 
 
 
 
 
 
 
 

IOStreams

Operators:

>> (istream), << (ostream)

CS151 -- Shawn Stoffer


 
 
 
 
 
 
 
 
 

IOStreams

Member functions:

char get();
friend int getline(istream cin, string whereToPut);

CS151 -- Shawn Stoffer


 
 
 
 
 

IOStreams

#include <fstream>

ifstream fin;
ofstream fout;

open member function:  fin.open("filename");
close member function:  fout.close("filename");

CS151 -- Shawn Stoffer


 
 
 
 
 
 
 
 
 
 
 
 
 

Classes

class Keyword
CS151 -- Shawn Stoffer


 
 
 
 

Classes

class className { classBody };
className
CS151 -- Shawn Stoffer


 
 
 
 

Classes

class className {
public:
  classBody
};
classBody
CS151 -- Shawn Stoffer


 
 
 

Classes

class className {
private:
  classBody
};
classBody
CS151 -- Shawn Stoffer


 
 
 
 

Classes

class className {
protected:
  classBody
};
classBody
CS151 -- Shawn Stoffer


 
 
 
 

Classes

class className {
  className();
  classBody
};
classBody
CS151 -- Shawn Stoffer


 
 
 
 
 

Classes

class className { classBody };
classBody
CS151 -- Shawn Stoffer


 
 
 
 
 
 
 
 

Classes

Reading Code:
CS151 -- Shawn Stoffer


 

Classes

Member variables
CS151 -- Shawn Stoffer


 
 
 
 
 

Classes

Member functions
CS151 -- Shawn Stoffer