
10-10-2005, 09:33
|
|
|
|
חבר מתאריך: 08.10.05
הודעות: 4
|
|
מה אומרת ההודעה הבאה:
Compiling...
Shapes.cpp
d:\learning\shapes\shapes.cpp(88) : fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
Shapes.exe - 1 error(s), 0 warning(s)
לתןכנית הזו: (כאשר שני הקלסים נמצאים בקבצי h נפרדים)
#include<iostream.h>
#include<math.h>
#include"rect.h"
#include"tringle.h"
int rect::area()
{int c;
c=a*b;
return(c);
}
int rect:  erimeter()
{int c;
c=2*(a+b);
return(c);
}
void rect ::show()
{
int i,j;
for(i=o,i<a,i++)
{cout<<'n\';
for (j=0,j<b,j++)
cout<<"*";}
cout<<'n\';
}
int tringle::area()
{int c;
c=(l*l)/2;
return(c);
}
int tringle:  erimeter()
{int r,c;
r=sqrt(2*l*l);
c=2*l+r;
return(c);
}
void tringle::show()
{int i,j;
for(i=1,i<=l,i++)
{
cout<<'n\';
for(j=1,j<=i,j++)
cout<<"*";}
cout<<'n\';
}
main()
{
rect r1;
tringle t1;
r1.a=5,r1.b=8;
t1=7;
cout<<"r1:a="<<r1.a<<" r1:b="<<r1.b<<'n\';
cout<<"r1:area="<<r1.area()<<'n\';
cout<<"r1  erimeter="<<r1.perimeter()<<'n\';
r1.show();
cout<<"t1="<<t1<<'n\';
cout<<"t1:area="<<t1.area()<<'n\';
cout<<"t1  erimeter="<<t1.perimeter()<<'n\';
t1.show();
return 0;
}
|