Creating separte strings from one string

My code reads from a file and stores them in strings. Say, I have a string and I want to break it down into separate strings on every white space character. For example, if string str1 contains the sentence "My name is Brock Lesnar". I want to create 5 separate strings holding "My", "name" and so on. Is that even doable? How about when you have a bunch of strings in an array and want to perform the same operation on that.
Last edited on
use strtok () function..... pass whitespace as the delimiter ....
hope that works
Topic archived. No new replies allowed.