- 366 名前:デフォルトの名無しさん mailto:sage [2009/06/14(日) 01:49:25 ]
- #include <iostream>
#include <string> #include <fstream> using namespace std; int main(){ string str; fstream file; file.open("test.txt",ios::in); file>>str; file.close(); int h=str.length(); cout << h<<endl;; const char *seq1 = new char[h]; seq1=str.data(); delete[] seq1; } これどこか悪いですかね?実行時に強制終了になってしまう。 削っていって原因の箇所を特定したところ、delete[] seq1; の一行が悪いみたいなんですが、正直何が悪いかが理解できんのです。 bcc5.5で作業中です。
|

|