#include <fstream>
#include <iostream>

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

    if (!read) { // 这跟python语法相似啊
        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();
}

 

相关文章:

  • 2022-12-23
  • 2021-12-12
  • 2022-01-07
  • 2022-02-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-17
猜你喜欢
  • 2022-01-04
  • 2021-04-13
  • 2021-10-14
  • 2021-10-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案