Question about arrays, get function

Hi, I was wondering what is the best way to make an array from an inputted line of integers that have 1 space between them. Should i use the get function?

get(anInt,'\n')

or

inputfile << storage[anInt] << '\n' <--- dont even think this is allowed



sorry, im a complete noob with c++
line of integers that have 1 space between them


I'm thinking of std::cin >> because it eats spaces but aren't there always better approaches than cin...e.g. using its member functions? I'm not pretty familiar with streams so...let's wait :P

EDIT: oh I missed the operator and said cin itself eats spaces...
Last edited on
I'm guessing that since they have a space, they are expecting you to use cin>> (even though I wouldn't normally suggest it).
Topic archived. No new replies allowed.