// cisweb.bristolcc.edu - CIS dept home page
// @topic T00100 First day lecture -- a snapshot of a "class"
// @brief class DriverLic, dynamically instantiated
#include <iostream>
#include <string>
class Picture {
//...
};
class DriverLic {
std::string fname;
std::string lname;
Picture pict_id;
public:
void print( int pid ) {
std::cout << fname << " " << lname;
}
};
int main() {
DriverLic* dl = new DriverLic;
int printer_id = 123456;
// Dereferencing a pointer to an object:
(*dl).print( printer_id );
// Using "member selector" operator to do the same:
dl->print( printer_id );
// How much space does DriverLic object occupies in memory?
std::cout << sizeof( DriverLic );
return 0;
}