I am trying to read all the characters in a file into an array. Assuming all variables are declared, why are all the characters not being read into my array. When I output some of the characters in the "storeCharacters[]" array, garbage is being returned. Please help.
This is my function:
void countChars(ifstream& input, char storeCharacters[])
{
int i = 0;
while( !input.eof() )
{
input.get(storeCharacters[i]);
i++;
}
}