This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
problem with g++
- From: Anjali Sharma <anjalis at cdotd dot ernet dot in>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 26 Mar 2003 14:53:05 +0530
- Subject: problem with g++
- >received: from aries.cdotd.ernet.in by cdotd.cdotd.ernet.in (SMI-8.6/SMI-SVR4)id PAA11299; Wed, 26 Mar 2003 15:01:11 -0500
- Organization: CDoT
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