Реферат: Объектно ориентированое програмирование на С
#include "conrectangle.h"
void main()
{
rectangle r1;
double a,b;
char s[1];
cout<<"\nESLI VAM ETA PROGA POKAZHETSA TUPOY... NE PEREZHYVAITE! ETO DEISTVITEL'NO TAK :)\n";
do
{
cout<<"\n Our rectangle:\n";
r1.print_rectangle();
cout<<"Input a, b:\n";
cin>>a>>b;
rectangle r2(a, b);
cout<<"\n Your rectangle:\n";
r2.print_rectangle();
r1=r2;
cout<<"\n Your rectangle is our now:\n";
r1.print_rectangle();
cout<<"Repeat or quit?(r/q)...";
cin>>s;
}
while (s[0]!='q');
return;
};
Результати:
D:\Studies\Labs\Cpp\Individ_6>ind1
The constructor "rectangle()" worked.
ESLI VAM ETA PROGA POKAZHETSA TUPOY... NE PEREZHYVAITE! ETO DEISTVITEL'NO TAK :)