How to read in spaces

This function reads in first and last correctly. What isn't correct is that when I read in answer, it ignores the blank spaces held in the file. How can I read in the answers in the file with the spaces included? Answer is a char and can't be a string.

1
2
3
4
5
6
7
8
void get_data(ifstream &inp, char first[], char last[], char answer[]){
    int i = 0;
    inp >> first;
    inp >> last;
    while(inp.peek() != '\n'){
    inp >> answer[i];
    i++;
    }
Topic archived. No new replies allowed.