SPO_JakaFurlan/seminar/malloc_0_size.c
2026-01-11 21:29:07 +01:00

17 lines
No EOL
358 B
C

#include <stdlib.h>
#include <stdio.h>
int main(){
int *ptr = malloc(0);
if(ptr == NULL){
printf("Vrednost ptr je NULL\n");
return 0;
}
printf("Vrednost ptr je %d\n", ptr);
int skrivnostnaVrednost = *ptr;
printf("SkrivnostnaVrednost na katero kaže prt je %d\n", skrivnostnaVrednost);
free(ptr);
return 0;
}