Separating string and printing both

Would someone be kind enough to write me an example of code that would take a user input and separate it into two lines please? I understand better when I see the exact code. Such as the user enters last/first and the program would separate it at the / and print it as reverse like so:

first
last

I have spent three hours reading and researching and I still cannot figure out how to do this. I can separate the input but can only print out the first part. Thanks.

Also, please use something simple like pointers or references, not Boost or any of that type of stuff. Thanks.
Last edited on
C++ standard library std::string has methods 'find', which returns an index, and 'substr', which creates a substring. Very simple.
I finally figured it out. Thanks all!
can someone write the code
No, unless you can. The code itself has no value nor use. The ability to figure it out, like newlearn33 did, each of us has to learn themselves.
Topic archived. No new replies allowed.