PDA

View Full Version : c error



newport_j
March 11th, 2010, 05:10 PM
I received the following error in compiling a c program.

:101: error: expected expression before ‘int’

The module is called by this lie:

VRT_RAY2_FIRST_GPU(int IRAY, int MINRAY, int MAXRAY, double TIMv,
double *ZRAYu, double *TRAYu, double *PCOSu, double PSINu,
int *NSRFU, int *NBTMu, int *NUPRu, int *NLWRu);

What is the error? I am a c newbie and I do not see it.

Newport_j

Zugzwang
March 11th, 2010, 05:14 PM
If you call a method, you do not supply types for each argument, this is only done when declaring a method.

newport_j
March 11th, 2010, 06:09 PM
So do I correct it by dropping the types of each argument in the calling line?

Newport_j

CptPicard
March 11th, 2010, 06:13 PM
Could I suggest you quickly read through K&R (http://en.wikipedia.org/wiki/The_C_Programming_Language_(book))? It's concise and will help you a lot in your endeavours...

era86
March 11th, 2010, 06:19 PM
I received the following error in compiling a c program.

:101: error: expected expression before ‘int’

The module is called by this lie:

VRT_RAY2_FIRST_GPU(int IRAY, int MINRAY, int MAXRAY, double TIMv,
double *ZRAYu, double *TRAYu, double *PCOSu, double PSINu,
int *NSRFU, int *NBTMu, int *NUPRu, int *NLWRu);

What is the error? I am a c newbie and I do not see it.

Newport_j

I believe this will depend on context. Are you trying to create a new function? Or are you calling a function? You're going to want to remove the type declarations if you are calling VRT_RAY2_FIRST().

soltanis
March 12th, 2010, 08:24 AM
This looks like a C function trying to be prototyped. It doesn't show a return type, though; unless it has a return type on the line above it, I would say that that's why.

Check line 100 for a return type, on its own line, without any semicolons.
If there isn't one then that's what needs to get fixed.