#include <fstream>
#include <iostream>
using namespace std;
int main(){
ifstream input;
input.open("kr.txt");
int n;
input >> n;
for(int i = 0; i < n; i++){
char line[16];
input.ignore(256, '/n');
input.get(eil, 16);
}
return 0;
}
I get the warning at the "input.ignore()". My file looks like this. 15 spaces separate the beginning of the line to the first number.
2
Rimas 195.5 45
Robertas 165 13
/n
is constant consisting of two chars, '/'
and 'n'
and you are not quoting it as a string, using "
, but as a char, using '
, hence warning.
Maybe you wanted to use backslash instead of slash, i.e. '\n'
?
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加