相关代码 |
|
#include #include class SomeClass { public: void show_with_this(void) { cout cout void show_without_this(void) { cout cout SomeClass(char *title, char *author) { strcpy(SomeClass::title, title); strcpy(SomeClass::author, author); }; private: char title[256]; char author[256]; }; void main(void) { SomeClass book("Jamsa's 1001 C/C++ Tips", "Jamsa"); book.show_with_this(); book.show_without_this(); }
相关资源 |
|