Sincrono
Technical User
- Sep 25, 2012
- 5
When errors appear at random, say, when the identical procedure sequences of a program crash only sometimes, first we doubt about the reliability of the code. But as in this example, I can't imagine how a simple initialization fails sometimes. Like the one below. The image shows an example of the error under a code compiled in Labwindows/CVI environment.
_buffer = (double*)malloc(elementos*sizeof(double));
for (iii=0; iii< elementos; iii++)
_buffer[iii]=0.0;
On the first iteration (iii=0), Labwindows shows a "Dereference to null pointer" error message.
I've heard that in this cases is better to change the programming language to other that deals better with dereferences.
Please help!!
_buffer = (double*)malloc(elementos*sizeof(double));
for (iii=0; iii< elementos; iii++)
_buffer[iii]=0.0;
On the first iteration (iii=0), Labwindows shows a "Dereference to null pointer" error message.
I've heard that in this cases is better to change the programming language to other that deals better with dereferences.
Please help!!