int check_alloc_noExit(void* p) - AmiralBl3ndic/CLib_v2 GitHub Wiki

int check_alloc_noExit(void* p)

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


Parameters:

  • void* p: the pointer to check

Return values:

  • 0 if pointer is NULL or 0 (badly allocated)
  • 1 if pointer is not NULL and not 0 (correctly allocated)

Example:

int* myPointer = malloc(sizeof(int));
if (check_alloc_noExit(myPointer) == 0)
{
    //Code in case of bad allocation
}
⚠️ **GitHub.com Fallback** ⚠️