コードをコンパイルしているときに、以下に報告されたエラーが表示されます。私が間違っていたところを訂正していただけますか?
->
(haveint
)の無効な型引数
私のコードは次のとおりです。
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
typedef struct bundles
{
char str[12];
struct bundles *right;
}bundle;
int main() {
/* Enter your code here. Read input from STDIN. Print output to STDOUT */
unsigned long N;
scanf("%lu", &N);
bundle *arr_nodes;
arr_nodes = malloc(sizeof(bundle)*100);
int i=5;
for(i=0;i<100;i++)
{
scanf("%s", &arr_nodes+i->str);
printf("%s", arr_nodes+i->str);
}
return 0;
}
これらの行で問題に直面しています:
scanf("%s", &arr_nodes+i->str);
printf("%s", arr_nodes+i->str);