#include<stdio.h>
#include<stdlib.h>
int main(void)
{
int num;
int i;
scanf("%d%", &num);
int **ptr=(int**)malloc(num*sizeof(int));
*ptr = (int*)malloc(3 * sizeof(int));
for (i = 0; i < num; i++)
{
scanf("%d %d%", &(ptr[i][0]), &(ptr[i][1]));
ptr[i][2] = ptr[i][0] + ptr[i][1];
}
}
运行时报错0x7930939E (ucrtbased.dll)处(位于 调试专用.exe 中)引发的异常: 0xC0000005: 写入位置 0xCDCDCDCD 时发生访问冲突。将ptr换成int ptr[num][3]类型却可以正常运行