C++ double* array, test allocation -


I have a doubt: I want to test that some arrays, lower and higher allocated before the function call or not. Function starts with this test:

  bool myMgr :: compute (myInput * solvInput, double * less, double * high) {if (high == NULL || low == NULL) Back untrue; / ...   

Am I testing anything, am I testing it correctly?

Thanks and relation

If you are testing if there are no two pointer tapes , Which will come back to the pile allot if they can not allocate enough memory, but you can not do beyond the beliefs of others:

  • They ! = NULL , but user-initiated: double * ptr = (double *) 5;
  • They could not have been "arrays" or: You do not have information about the number of allocated elements.

Comments