I’m getting an error in Visual C++ that is giving me a really hard time.
The error is error c2143 reading: syntax error: missing ‘)’ before ‘constant’
My code line is:
coefficient[i] = (1 - (2 * depth)) + ((t - floor( t + 0.5 ) + 1 ) 2 * depth);
I have #include at the beginning of the file which should define the floor(double) function.
a bit more explanation of the variables.
double depth is a member variable of the class which this line can be found in.
int i is an incrementing index value.
double t is an incrementing value.
What they do is really unimportant, but I wanted to clarify that all three are already defined as variables of basic types.
I’ve gone through and verified that all the parentheses match up. I’m kind of at a loss as to what ‘constant’ the compiler is referring to. Any ideas?
I’m not quite sure if this is the same error that the compiler is giving you, but you have to put a ‘*’ sign in front of the second ‘2’ so that this:
Becomes this: