定義したget_E1関数を他の関数から呼び出す仕組みなのですが、コンパイル時にエラーも出ず、ただ、E1.txtの内部が表示されません。どなたかお分かりになる方いらっしゃいますでしょうか?
C++
1#include <iostream> 2#include <fstream> 3#include <string> 4#include "../include/Event.hpp" 5 6using namespace std; 7void get_E1 (void) { 8 string s; 9 ifstream infile; 10 infile.open("E1.txt"); 11 if (infile.is_open()) { 12 while (!infile.eof()) { 13 getline(infile, s); 14 cout << s << endl; 15 } 16 } 17infile.close(); 18} 19
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/05/03 07:24
2018/05/03 07:29