码迷,mamicode.com
首页 > 编程语言 > 详细

c++ read

时间:2015-11-04 07:04:17      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:

#include <fstream>
#include <iostream>

int main(void) {
    char url[1000] = {0};
    int buff_len = 1000;
    std::ifstream read("./urls");

    if (!read) {
        std::cout << "open file err!" << std::endl;
        return -1;
    }

    while( !(read.peek() == EOF) ) {
        read.getline(url, buff_len);
        std::cout << url << std::endl;
    }

    read.close();
}

 

c++ read

标签:

原文地址:http://www.cnblogs.com/i80386/p/4934915.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!