My C Quiz

The ultimate place to learn C!

Question #13: When running the program below, the malloc statement will always be executed?

#include <stdlib.h>
#include <stdio.h>

int* ptrToData;

int main(){

    if (!ptrToData){
        ptrToData = (int*)malloc(sizeof(int) * 10);
        printf("%p\n", ptrToData);
    }

    free(ptrToData);
    return 0;
}