Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Getting back into C programming



On 05/12/06, Stuart Luppescu <s-luppescu@example.com> wrote:

Hello all, I need some advice. I wrote a mostly C (with a little C++)
program more than 10 years ago using a some now-forgotten MS-DOS C
compiler.
[...]
For example, I have a random number generating routine
that I cribbed from Numerical Recipes. The definition (? first line of
the function) looks like this:

float ran0(int &idum)

the declaration like this:

float ran0(int &);

These lines gives these error messages, where gcc used to not complain
at all:

test-thresh.c:28: error: expected ';', ',' or ')' before '&' token
test-thresh.c:77: error: expected ';', ',' or ')' before '&' token

Let me guess, you are invoking gcc on this, right? Try g++.

References are a C++ thing, and do not compile in C.

-Josh


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links