Reading comma separated values to and from an array

  • (2 Pages)
  • +
  • 1
  • 2

15 Replies - 1595 Views - Last Post: 19 February 2013 - 01:22 PM Rate Topic: -----

#16 jimblumberg  Icon User is offline

  • member icon


Reputation: 4068
  • View blog
  • Posts: 12,550
  • Joined: 25-December 09

Re: Reading comma separated values to and from an array

Posted 19 February 2013 - 01:22 PM

Quote

I still don't understand how it knows to stop at the end of one line during one loop cycle and then pick up from there and get the next line during the next cycle.


Because the end of line character is a whitespace character, and by default the C++ input stream ignores whitespace. See these links: operator>> and the skipws manipulator.

Also you need to realize that to C/C++ there is little if any difference between operating on the console or operating on a file.


Jim

This post has been edited by jimblumberg: 19 February 2013 - 01:24 PM

Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2