MIPI_AdvancedC_FRTK/Lect2/29.c

22 lines
367 B
C
Raw Permalink Normal View History

2024-11-14 08:45:50 +03:00
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
{
int* p1;
p1 = malloc(sizeof(int));
*p1 = 99;
free(p1);
*p1 = 100; // ОШИБКА! память не определена
}
{
int* p1;
p1 = malloc(sizeof(int));
*p1 = 99;
*p1 = 100;
free(p1);
}
return 0;
}