0
我對C++使用boost庫相對來說比較新,我想知道如何使用它打開文件。我的目標是從json文件讀取,但我不知道如何打開文件。如何在boost中打開文件
在C++中,你可以做到這一點
int main() {
ofstream myfile;
myfile.open ("example.txt");
myfile << "Writing this to a file.\n";
myfile.close();
return 0;
}
,但我怎麼能做到這一點使用升壓?
也許SO項目[序列化和反序列化JSON與提升](http://stackoverflow.com/questions/12394472/serializing-and-deserializing-json-with-boost)將有所幫助。 –
使用boost在這裏不會增加太多。 – shoosh
Boost只是一個圖書館。它增加了標準庫_doesn't_沒有的東西。這不是**這種事情的例子。 – sehe