predstavitev seminarja
This commit is contained in:
parent
a82fd0ab4e
commit
f7a1d65649
7 changed files with 49 additions and 0 deletions
17
seminar/malloc_0_size.c
Normal file
17
seminar/malloc_0_size.c
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue