so i am trying to write a program that reads some data in from a text file and performs an operation on that data. the text file is as follows...
611111 5
765676 4
876787 4
987897 2
611111 4
now i want the program to read that and see that 611111 is there twice and will add its corresponding values so 611111 will then have a corresponding value of 9. i did some research and found out a map is probably what i need to do this but thats where i am getting confused. im not exactly sure how to read the data into the map from a text file and then how to pick out if there are any similar numbers in the first column.
im not even sure why i am posting what i have so far since i know it is probably embarressingly wrong (especially since i have been working on this for a couple days now). thank you ahead of time!!!
oh and i am using dev-c++ so i cant use strings
char accountNum[6];
int amount;
map<char,int , ltstr> report;
while (!inLN.eof())
{
inLN.getline(accountNum,6);
report[accountNum] = amount;
}