0
我一直在试图解决这一问题的错误几个小时,但有我丢失的东西:我有一个结构声明为类类型的错误C++与结构
:
typedef struct {
bool active;
unsigned long bbcount;
char buffer[BUFFSIZE];
std::set<__uint> *bblist;
} per_thread_t;
后来我中号分配它的内存和设置一些变量,包括set
这样的:
per_thread_t *data = (per_thread_t *)malloc(sizeof(per_thread_t));
data->active = false;
data->bblist = new std::set<__uint>();
data->bblist.find(6328);
但我得到的错误error C2228: left of '.find' must have class/struct/union
。
我在这里做错了什么?
谢谢
' - >'为指针。您需要取消引用指针。所以你可以去'(* data-> bblist).find'或'data-> bblist-> find'。 – Freddy