Код: Выделить всё
#include
#include
int main(){
int *p = (int*)malloc(sizeof(int));
int *q = (int*)realloc(p, sizeof(int));
*p = 1;
*q = 2;
if (p == q)
printf("%d %d", *p, *q);
return 0;
}
Это ошибка?
Код: Выделить всё
int *p = (int*)malloc(sizeof(int));
*p = 1;
Подробнее здесь: https://stackoverflow.com/questions/294 ... s-00-vs-03
Мобильная версия