SCANF的小問題
程序代码:#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
typedef struct _bmiData{
int kg;
float height;
float bmi;
char *bmiDef;
}BMIDATA;
int main(){
int i;
int amount;
scanf("%d", &amount);
BMIDATA **data = (BMIDATA**)malloc(amount * sizeof(BMIDATA));
for (i = 0; i < amount; i++){
scanf("%d", &((*(data + i))->kg));
printf("%d", (*(data + i))->kg);
}
free(data);
}請問為什麼上面這樣,
scanf("%d", &((*(data + i))->kg)); <-- 這樣運行時會出現錯誤呢?
我想了好久還是沒解答,請教各位大神!! 大恩不言謝~









