Here is the question. I need to read some names from a file, for example:
James Brown /n
Peter Lee /n
Chris Wu /n
Steven Huang /n
Kelly Yang /n
First, I need to know how long the longest name in the input stream is, then I need to create a dynamic 2-D char array. Finally, put the names into the dynamic array.(In this case,I need to create a 5*12 array since there are 12 letters in "Steven Huang".)
How can I read the input stream to know the number '12' but not extract them to put them into the array using cin>>
in C++?
All suggestions will be appreciated.