为了简单起见我把这个问题抽离出来。大家给我一点建议吧!
代码: 全选
#include "stdio.h"
#include "malloc.h"
typedef struct { int leader;
int loder;
int tag;
}HT;
int main( )
{
HT p;
p=(HT)malloc(sizeof(HT));
}
代码: 全选
|| h.c: In function ‘int main()’:
h.c|14 col 24| error: no matching function for call to ‘HT::HT(void*)’
h.c|14 col 24| note: candidates are:
h.c|6 col 2| note: HT::HT()
h.c|6 col 2| note: candidate expects 0 arguments, 1 provided
h.c|6 col 2| note: HT::HT(const HT&)
h.c|6 col 2| note: no known conversion for argument 1 from ‘void*’ to ‘const HT&’