How would I go about splitting a string into tokens? I want to be able to input a string such as "cmd www http://www.google.com" and it would parse "cmd" as "command" and "www" as a parameter for using the web browser, and the last parameter as the url. I'm making a program that the user can input those types of things and it runs them. Kinda like the command prompt I guess.
There are very many ways to do this. One way that comes to mind is using the stringstream class to parse your input. If you have the user input the data as one string, you could do this: