hey, there, i am wondering whether a static array is similar to a static variable, which hold value between subsequent calls.
Code:
void readdata(){
double workspace[3600];
...
}
and I will call the readdata() in a while loop. I am worrying that it is not efficient, since each call will allocate and deallocate the workspace[3600]. So does static array do the job?
Code:
void readdata(){
static double workspace[3600];
...
}
For reason of clarity, I want to keep the workspace[100] inside readdata() since that's the only place it is used. To pull it out and place it in the caller is not what I want.
Thanks for your reply.