`
wihoho
  • 浏览: 9007 次
  • 性别: Icon_minigender_1
  • 来自: Singapore
最近访客 更多访客>>
社区版块
存档分类
最新评论

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

1
1
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics