Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Arrays 表达式必须具有指向数组中对象类型错误的指针 #包括 #定义尺寸10 类型定义结构{ int nelem;//数组中的数字量 整数向量[DIM]; }t_向量_int; int main(){ t_vector_int vect={5,{3,23,56,109,238}; int n,i=0; printf(“病媒生物学:3,23,56,109,238\n\n肠道疾病研究所:”); scanf(“%d”和“&n”); while(vect[i]_Arrays_C_Structure - Fatal编程技术网

Arrays 表达式必须具有指向数组中对象类型错误的指针 #包括 #定义尺寸10 类型定义结构{ int nelem;//数组中的数字量 整数向量[DIM]; }t_向量_int; int main(){ t_vector_int vect={5,{3,23,56,109,238}; int n,i=0; printf(“病媒生物学:3,23,56,109,238\n\n肠道疾病研究所:”); scanf(“%d”和“&n”); while(vect[i]

Arrays 表达式必须具有指向数组中对象类型错误的指针 #包括 #定义尺寸10 类型定义结构{ int nelem;//数组中的数字量 整数向量[DIM]; }t_向量_int; int main(){ t_vector_int vect={5,{3,23,56,109,238}; int n,i=0; printf(“病媒生物学:3,23,56,109,238\n\n肠道疾病研究所:”); scanf(“%d”和“&n”); while(vect[i],arrays,c,structure,Arrays,C,Structure,您需要使用成员vector,而不是结构变量本身 改变 #include <stdio.h> #define DIM 10 typedef struct{ int nelem; //amount of numbers in the array int vector[DIM]; }t_vector_int; int main(){ t_vector_int vect={5,{3, 23, 56, 109, 238}}; int n, i=0;

您需要使用成员
vector
,而不是结构变量本身

改变

#include <stdio.h>
#define DIM 10

typedef struct{
    int nelem; //amount of numbers in the array
    int vector[DIM];
}t_vector_int;

int main(){
    t_vector_int vect={5,{3, 23, 56, 109, 238}};
    int n, i=0;

    printf(" Vector inicial: 3, 23, 56, 109, 238\n\nIntroduzca un valor entero: ");
    scanf("%d", &n);
    while(vect[i] <= n){

    }

    return 0;
}
while(向量[i]
 while(vect[i] <= n)
while(vect.vector[i] <= n)