here is my code. Here is a quick review of what i need to do: open a file of a list of numbers and get the first number and tally it for that number. Ex. number is 4563 it tallys 1 for number 4. And 2983 it tallys 1 for number 2. and loops through whole list and tallys numbers 1 - 9 and records them in the output. This outputs what i say but it outputs 0's for 1-9 instead of how many times it found a number that started with 1 and etc through 9. What it is doing is it outputs 0's for the 1 - 9 instead of what it was supposed to loop and find how many times 1-9 is used. Is it something with my num11 being set. If so could someone help me out.
int main ()
{
ifstream inFile;
int number, num1=0, num2=0, num3=0, num4=0, num5=0, num6=0, num7=0, num8=0, num9=0;
string num11;
int totals[10]={};
inFile >> num11;
cout << "Enter 1 for librarybooks or Enter 2 for livejournal : ";
cin >> number;
if ( number == 1 )
{
inFile.open("librarybooks-1.txt");
}
else if ( number == 2 )
{
inFile.open("livejournal-1.txt");
}