I've just started with C++ a few weeks ago and need some help for my "homework".
I need to read:
row1: int int
row2: int char
from a text file. My code looks like this:
int main() {
[...]
ifstream fin(argv[1]);
int i{0}, tmp;
while (fin >> tmp) {
cout << pos << "zahl" << tmp << endl;
if (pos == 0) {
wagen = tmp;
} // needed for an array
if (pos == 1) {
reihen = tmp;
}
i++;
[...] return 0;
}
my problem is how do you work around row2+
? I tried typecasting and googled for over a hour but didn't found anything useful.