我在编译我的代码时遇到下面报告的错误。你能纠正我在我错误的地方吗?的->
无效类型参数' - >'(有'int')
无效的类型参数(有
int
)
我的代码如下:
#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);
感谢iharob。有效。我不知道括号。现在有道理。 – SPradhan