Splitting an Input String With substr Only

I got myself a C++ book because i start uni in a few months for computer pogramming, so i fogured I'd expose myself to it. There's a problem in my book that asks to output an input that is "some street address, some city, state, some zipcode" the input can vary so it has to work it any info that is given
The example it gives is:
123 pittsburgh ave, los angeles, CA 15334
Then the output for it is:
123 pittsburgh ave
Los angeles, CA
15334
I cant seem to figure it out since there are three commas. I used a substr(0, comma) to get the street address. But cant figure out the rest of it. Can anyone help me out? Thanks in advance
Last edited on
Topic archived. No new replies allowed.