and its called testfile.txt
using codeblocks, i am trying to read the numbers into 3 different int variables called totalPeople, drinkingInterval, and yourPosition in that order. so far this is what i have:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#include<iostream>
#include<fstream>
usingnamespace std;
int totalPeople;
int drinkingInterval;
int yourPosition;
int main () {
ifstream indata;
indata.open (testfile.txt)
indata>>totalPeople>>drinkingInterval>>yourPosition;
cout<<totalpeople;
}
What am i doing wrong? im not even sure if its opening the txt file..
~note. thats not the entire code, just what i found relevant. its part of a much larger program.
im putting this in a loop to read the rest of the data, right now im trying to read row one.