This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

problem with g++


Hi All,

 I am trying to compile a sample .cpp  file using g++ :-

int addptc(a)
int a;
{
 a=123;
}

I get the following errors :-
try.cpp:1: `a' was not declared in this scope
try.cpp:2: syntax error before `int'

If I use the new style format for function arguments as follows :-
int addptc(int a)
{
a=123;
}

then there are no such errors.

Could anyone please suggest if there is any solution by passing command
line options to g++ ,instead of changing the source code ?

Thanks ,
Anjali





Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]