讀檔問題
文字檔的內容如下
1 2 3 4 5 6 7 8 9 : 33
2 3 5 6 7 2 5 3 1 : 25
..
..
我想把文字檔的內容進一陣列裡
應該怎麼用呢
[解决办法]
阵列?数组?
以空格隔开的话
ifstream fs( "your.txt ");
vector <int> ivec;
string line,word;
while(getline(fs,line)) { //以流的方式打开sData.txt
istringstream stream(line);
while(stream> > word)
ivec.push_back( itoa(word) );
}