常用代码段

1.C++读取txt文本数据

ifstream infile;

string num;

int x;

infile.open("xxx.txt");
while(infile>>num)
{ 
    x = atoi(num.c_str());
   
}

 

posted @ 2017-01-16 21:59  雨落无声2002  阅读(119)  评论(0编辑  收藏  举报