int check_alloc_noExit(void* p) - AmiralBl3ndic/CLib_v2 GitHub Wiki
This function checks if a given pointer is correctly allocated (if it does point on something that is not 0 or NULL)
Contrary to check_alloc(void* p), this function will not cause the program to stop if the pointer is badly allocated
- void* p: the pointer to check
-
0if pointer isNULLor0(badly allocated) -
1if pointer is notNULLand not0(correctly allocated)
int* myPointer = malloc(sizeof(int));
if (check_alloc_noExit(myPointer) == 0)
{
//Code in case of bad allocation
}