2011-11-29 80 views
1

开始从文件中读取简单的字符串,但当我在变量值中看到我保持看到垃圾我怎么能清理它?如何清理从字符串stl字符串C++

string line; 
ifstream fp_in; // declarations of streams fp_in and fp_out 
fp_in.open("test.txt",std::ios_base::in); // open the streams 
if(fp_in.is_open()) 
{ 
    while (!fp_in.eof()) 
     {  
     getline (fp_in,line,'\n'); 
... 
... 

但在 “行” 的字符串,我看到的乞讨: ן»¿{ “数据”:[{ “ID”: “19513xxxx46141_326xxxx15447”,......
?我怎样才能摆脱它 ?

回答