Jan 3, 2012 at 12:27pm UTC
Please help :)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
#include <iostream>
using namespace std;
struct Piramida
{
double bok;
double wysokosc;
};
double obliczObjetosc (struct Piramida p)
{
return (1/3)*p.bok*p.bok*p.wysokosc;
}
int main()
{
struct Piramida A;
A.bok = 10.0;
A.wysokosc = 3.0;
cout << "Bok podstawy: " << A.bok << ", wysokosc piramidy: " << A.wysokosc << "." << endl; << "Objetosc piramidy to: " << obliczObjetosc(A) << endl;
system("PAUSE" );
return 0;
}
Error list:
error C2143: syntax error : missing ';' before '<<'
Last edited on Jan 3, 2012 at 12:28pm UTC
Jan 3, 2012 at 12:34pm UTC
you have an extra semi-colon after the first endl, on the following line
cout << "Bok podstawy: " << A.bok << ", wysokosc piramidy: " << A.wysokosc << "." << endl; << "Objetosc piramidy to: " << obliczObjetosc(A) << endl;
and that's causing the error.
Last edited on Jan 3, 2012 at 12:35pm UTC
Jan 3, 2012 at 2:11pm UTC
just one note--the debugger or the error list provided is always a VERY useful tool to help you when something goes wrong.....thats why they are called "debugger" :)
@Brayan