Ask your own question, for FREE!
Computer Science 4 Online
OpenStudy (anonymous):

anyone know hot to fix: error: invalid conversion from `const double (*)[3]' to `double (*)[3]'

OpenStudy (anonymous):

what code are you having trouble with?

OpenStudy (anonymous):

I would bet that you are modifying a constant pointer-to-array variable somewhere. But you need to let us see the code.

OpenStudy (anonymous):

I have that happen all the times: u just gota change ur pointer.

OpenStudy (anonymous):

Are you familiar with the const keyword and const pointers? If not, it's a good topic to read up on - const correctness can make your code safer and more reliable. const double * and double * are two different types that can't be cast between implicitly. In C, you should use an explicit cast like so: const double *src; double *dst; dst = (double*)src; In C++, you should use const_cast: dst = const_cast<double*>(src); Generally, if you're compiling C++, never use C-style casts. There's no compile-time or runtime checking, and they're relatively unsafe.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!