Arrays in classes with two arguments

#include<iostream>
using namespace std;
class c1 {
int i;
int h;
public:
c1(int j,int k) {i=j,h=k;}
int get_i() {return i;}
int get_h() {return h;}
};
int main()
{
c1 ob[3]= { c1(1, 2),c1(3, 4),c1(5 , 6) };
int i;
for(i=0;i<3;i++){
cout<<endl<<ob[i].get_h();
cout<<endl<<ob[i].get_i();
}
return 0;

Advertisements