This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Programming question--Reference parameters. Thanks
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: QiangHuang <jameshq at liverpool dot ac dot uk>
- Cc: Ecos-Discuss <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 7 May 2003 11:31:57 +0200
- Subject: Re: [ECOS] Programming question--Reference parameters. Thanks
- References: <ONEOIJPPOKNBBKJKCGLCMEJJCAAA.jameshq@liv.ac.uk>
On Wed, May 07, 2003 at 10:25:10AM +0100, QiangHuang wrote:
> Hi all:
> I am using the arm-elf-gcc, I wonder whether I can use reference
> parameter in function. I tried this:
>
> void fun1(int &a)
> {
> // do somthing here
>
> }
>
> but seems the compiler can not recognize '&' here and report an error:
> "parse error before '&' token"
>
> so is reference parameter is not supported in arm-elf-gcc ?
This is a C++ thing isn't it. Does the compiler know the source file
is C++? It could be trying to compile it as good old plain C.
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss