con_init.cpp
Upload User: dq031136
Upload Date: 2022-08-08
Package Size: 802k
Code Size: 0k
Development Platform:

C++ Builder

  1. #include <iostream.h>
  2. class object
  3.  {
  4.    public: 
  5.      object::object(void);
  6.      void show_object(void);
  7.    private:
  8.      int a;
  9.      int b;
  10.      int c;
  11.  };
  12. object::object(void) : a(1), b(2), c(3) { };
  13. void object::show_object(void)
  14.  {
  15.    cout << "a contains: " << a << endl;
  16.    cout << "b contains: " << b << endl;
  17.    cout << "c contains: " << c << endl;
  18.  }
  19. void main(void)
  20.  {
  21.    object numbers;
  22.    numbers.show_object();
  23.  }