Memory Drive

반응형
  1. #include <iostream>
  2. using namespace std;
  3. class Student
  4. {
  5. const int id;
  6. int age;
  7. char name[20];
  8. public :
  9. Student(int _id, int _age, char *_name) : id(_id)
  10. {
  11. age = _age;
  12. strcpy(name,_name);
  13. }
  14. void Show()
  15. {
  16. cout << " " << id << endl;
  17. cout << " " << age << endl;
  18. cout << " " << name << endl;
  19. }
  20. };
  21. int main()
  22. {
  23. Student st(2002, 20,"good");
  24. st.Show();
  25. return 0;
  26. }
 
반응형

'Computer_IT > C++' 카테고리의 다른 글

[VC] MMX support 여부  (0) 2006.08.14
Example Program: A Simple Query  (0) 2006.08.07
LinkedList 자료  (0) 2006.04.06
VC++ 단축키 모음  (2) 2006.03.19
Console - 바둑소스  (0) 2006.02.22