2009-04-02から1日間の記事一覧
stringで作った文字列をc_str()でconst char*に受けたとき、後でそれを参照しようとすると値が破壊されている。ソースはこんな感じ。 #include <iostream> #include <mpi.h> #include <string> #include <sstream> #include <fstream> #include <iomanip> using namespace std; int main(int argc,char **argv){ i</iomanip></fstream></sstream></string></mpi.h></iostream>…