Re: Errors with cstdio, cstring and int &a
Rayne wrote:
I'm trying to port code written by someone else from Linux to Windows,
and am having some trouble with the errors reported by the compiler.
I'm using Visual Studio .NET 2003.
I'm getting hundreds of error messages such as
C:\Program Files (x86)\Microsoft Visual Studio .NET 2003\Vc7\include
\cstdio(29) : error C2059: syntax error : ':'
Your code gets compiled as C rather than C++. Do your source files have =
a .c extension, by any chance? You can force them to be compiled as C++ =
with Project | Properties | C/C++ | Advanced | Compile As.
Another problem I have is that one of the functions is declared as
follows:
BOOL function_name(int &a, int &b);
I get the "error C2059: syntax error: '&'" message. Is passing by
reference not allowed?
Not in C, no.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not =
necessarily a good idea. It is hard to be sure where they are going to =
land, and it could be dangerous sitting under them as they fly overhead. =
-- RFC 1925