Day 六: User-defined datatypes

Day 6: User-defined datatypesclassA user-defined datatype which groups together related pieces of i

Day 6: User-defined datatypes

class

A user-defined datatype which groups together related pieces of information

Instance

An instance is an occurrence of a class
class student{public:    char *name;    int studentID;};int main(){    student s1;    student s2;}

?

Constructor

Method that is calle whien an instance is created.

struct: public by default

class: ?private by default