Need help on substrings and streams

This is a discussion on Need help on substrings and streams within the C++ Programming forums, part of the General Programming Boards category; So i understand the substring method takes the first char position, and then takes in the the length (amount of ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    103

    Need help on substrings and streams

    So i understand the substring method takes the first char position, and then takes in the the length (amount of chars after that initial position). But how would I determine that position if I'm passing in a stream? (the initial position stays the same but the length is always changing)?

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    How many characters do you want, is what the function is asking for, not how many there are. (If you want "all the characters to the end", then leave it off and that's the default parameter.)

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    7,317
    What substring method are you talking about? substr()? How can you pass a stream to the substring method?

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21