LogiQuest
Back to Memory Allocation
8

What will be the output of the program?

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

int main(void) {
    int *p = malloc(sizeof(int));
    if (!p) return 1;
    *p = 99;
    printf("%d\n", *p);
    free(p);
    return 0;
}
Easy

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.