static double *var = (double*) malloc(100000*sizeof(double));
is used among other memory allocations to store data that comes from a
..mat file
The declarations are done on the main .cpp file and then used by other
..cpp files one
of those files is similar to the following:
http://www.mathworks.com/access/help...al/f32276.html
The code is ansi c, and .cpp files are used because MS VC is used to
compile the hole program.
From one time to the other the program began crashing and it was
noticed that removing
some static double global declarations and mallocs help to run it with
out crashing.
I´m not sure what is the problem, if memory reached limits or if my
programming is so bad
that I can´t allocate more memory space, or many globals are declared.
The questions are:
1.- Is the other way to access globaly the data of the .mat file using
ansi C and many other
..cpp files included in compilation?
2.- Declaring
static mxarray pa1
var[x] = (mxGetPr(pa1))[x];
where main() is declared would allow having global access to the .mat
data without the need
of storing every thing on allocated memory space?
As a beginner programming I'm sorry if the questions are very silly but
I don't know about a real good book where one can learn to give
structure to ansi c programms nor I didn't find good information on the
internet.
Best Regards and Thank you