#include
#include
using namespace std;
typedef struct node {//节点结构体
int value;
}node;
typedef struct tree {//树结构体
node* father;
set
}tree;
tree* root = nullptr;//根节点
void f() {//对根节点初始化
root= (tree*)malloc(sizeof(tree));
if (root == NULL)
return;
root->father = NULL;
root->child.clear();//问题所在,访问地址权限冲突
printf("%d", root->child.size());//打印的值也不是-1
}
int main() {
f();
}
你想问什么问题,或者想表达什么?