[Dev-C++] Dev - C++ function syntax problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Peter C. <pet...@li...> - 2001-10-02 08:28:18
|
Hello I started learning C++ a week ago, and was beginning to think it
wasn't half as difficult as it's made out to be. Then I tried a minimalist
program to demonstrate the syntax of calling a function.
With the program below I get the compiler message " parse error before
'{' " relating to opening curly bracket of return s1* s2. Any ideas about
what is wrong, nothing I do cures it.
#include <iostream.h>
int area( int s1, int s2);
int main()
{
int vol;
vol = area(12, 13);
int area( int s1, int s2 )
{
return s1*s2;
}
return 0;
}
From Peter Cartwright
|