I'm currently working on a simulation of the motion of magnets on a rod. As part of it, there are arrays of the properties of the magnets:
long double *accelerations; // These will later be dynamically allocated depending on the number
long double *velocities; // of magnets
long double *positions;
However, when I go to compile this, the compiler gives me these error for the pointers:
error: two or more data types in declaration of 'accelerations'
error: two or more data types in declaration of 'velocities'
error: two or more data types in declaration of 'positions'
Apparently, the compiler isn't recognising long double* as a type and is instead reading is as the two types long and double*. Does anyone know why and/or how to fix it?
PS - my compiler is MinGW 4.4.3
Last edited on
I'm assuming that you have semicolons in your actual code. What compiler/version are you using?
And, as it says in the question, my compiler is MinGW 4.4.3 (with CodeBlocks IDE).
Speaking of stupid mistakes, i had missed a semicolon after a class, which screwed everything up.
@aaronfjerstad, thanks for the attention + i hope you didn't waste too much time on me
I had finals week. Not enough time to do much else. I'm glad you figured it out.