在http://sequitur.info/sequitur_simple.cc有一个代码
我改变了malloc
和free
线
R = (rules **) malloc(sizeof(rules *) * num_rules);
free(R);
到new
和delete
R = (rules **) new(sizeof(rules *) * num_rules); //ERROR
delete(R);
但是g++
显示此错误:
error: expected type-specifier before â;â token
error: invalid conversion from âlong unsigned intâ to âvoid*â [-fpermissive]
/usr/include/c++/4.6/new:103:14: error: initializing argument 2 of âvoid* operator new(std::size_t, void*)â [-fpermissive]