Visual C++ を使用して、ゲームを GNU/Linux から Windows に移植しています。
問題は次のとおりです。
std::stringstream sstm;
/// *working on stringstream*
const int size = sstm.str().size();
char buffer[size];
std::ofstream outfile("options", std::ofstream::binary);
for(int i = 0; i < size; i++)
buffer[i] = sstm.str().at(i);
outfile.write(buffer, size);
outfile.close();
バッファの宣言では、「式には定数値が必要です」と書かれています。
私はこれを次のように変更しました:
std::vector<char>buffer(size);
そして、VC は、outfile.write() で「パラメーター 1 を 'std::vector<_Ty>' から 'const char *' に変換できません」と言います。