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:
1 2 3
longdouble *accelerations; // These will later be dynamically allocated depending on the number
longdouble *velocities; // of magnets
longdouble *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?