这段代码:
#include <stdlib.h>
#include <stdio.h>
int j_btree_create (int fn_initial_nodes);
typedef struct {
int depth;
int value;
void *item;
void *left_pointer;
void *right_pointer;
} j_btree_node_int;
typedef struct {
int nodes;
int available_nodes;
int btree_extension;
} j_btree_descriptor_int;
int j_btree_create (int fn_initial_nodes) {
int *free_btree_node;
int loop_counter;
j_btree_descriptor_int *btree_start;
btree_start = (j_btree_descriptor_int *) malloc (((sizeof(j_btree_node_int) + sizeof(free_btree_node)) * fn_initial_nodes) + sizeof(j_btree_descriptor_int));
printf ("btree_start: " . btree_start);
/* *btree_start.nodes = fn_initial_nodes;
*btree_start.available_nodes = fn_initial_nodes;
*btree_start.extension = NULL; */
for (loop_counter = 0; loop_counter < fn_initial_nodes; loop_counter++) {
printf ("loop_test:" . loop_counter);
}
}
产生此错误:
/home/jamie/aws/btree_int.c||在函数“j_btree_create”中:| /home/jamie/aws/btree_int.c|28|错误:在不是结构或联合的东西中请求成员“btree_start”| /home/jamie/aws/btree_int.c|33|错误:在不是结构或联合的东西中请求成员“loop_counter”| ||=== 构建完成:2 个错误,0 个警告 ===|
使用 CodeBlocks 编译时。我还没有设法找到我的问题的确切答案(我看过),有人知道我做错了什么吗?鉴于我对 C 相当陌生,可能不止一件事。