小编Jam*_*yen的帖子

为什么我不断收到“错误:变量的类型不完整'struct intVec'?

我正在为我的数据结构课程做作业,但我对 C 结构和 C 的总体经验很少。这是给我分配的 .h 文件:

#ifndef C101IntVec
#define C101IntVec

typedef struct IntVecNode* IntVec;

static const int intInitCap = 4;

int intTop(IntVec myVec);

int intData(IntVec myVec, int i);

int intSize(IntVec myVec);

int intCapacity(IntVec myVec);

IntVec intMakeEmptyVec(void);

void intVecPush(IntVec myVec, int newE);

void intVecPop(IntVec myVec);

#endif
Run Code Online (Sandbox Code Playgroud)

这是我所做的 .c 实现:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "intVec.h"

typedef struct IntVecNode {
    int* data;
    int sz;         // Number of elements that contain data
    int capacity;   // How much is allocated to …
Run Code Online (Sandbox Code Playgroud)

c struct compiler-errors incomplete-type

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

c ×1

compiler-errors ×1

incomplete-type ×1

struct ×1