nicoqwerty
i tried to follow your example but i got 2 errors
Code:
#include <iostream>
using namespace std;
struct Carpet {
float lengthInFeet;
float widthInFeet;
};
float displayArea (Carpet myCarpet)
--> int main( length * width)
{
struct Carpet myCarpet;
myCarpet.lengthInFeet=5.62;
myCarpet.widthInFeet=2.21;
cout<<"Length:" <<myCarpet.lengthInFeet
cout<<"Width:" <<myCarpet.widthInFeet
cout<<"Area is:"; <<displayArea
return 0;
}
float displayArea(float length, float width)
return(lengthInFeet * widthInFeet)
}
C:\Documents and Settings\Administrator\Desktop\proj2\carp2.cpp(12) : warning C4518: 'int ' : storage-class or type specifier(s) unexpected here; ignored
C:\Documents and Settings\Administrator\Desktop\proj2\carp2.cpp(12) : error C2146: syntax error : missing ';' before identifier 'main'
C:\Documents and Settings\Administrator\Desktop\proj2\carp2.cpp(12) : fatal error C1004: unexpected end of file found
Error executing cl.exe.
carp2.obj - 2 error(s), 1 warning(s)