//cpp代码
ifstream myfile;
myfile.open("D:\Spot\data\simpledata.txt");
string content((std::istreambuf_iterator(myfile)),
(istreambuf_iterator()));
myfile.close();
char* chr = &content[0];
return char;
//节点代码
var libSpotcolor = ffi.Library(fileName, {
'test': ["char *", []]
});
var testdata =libSpotcolor.test(); // Here node is crashing
console.log(testdata);
var save_json = testdata.readCString();
我可以获得更多的 1 mb 数据吗?如果没有,还有其他方法可以得到吗?