Randomizing string placement in an array

I need to take my string of 6 words, then scramble them into a different order, then output to the console.
string line1[] = {"I", "Can", "Do", "That", "Hold", "My", "Beer"};
You can use std::random_shuffle in the <algorithm> header:


(Basically, it's just random_shuffle(line1, line1+7); in your case)
Topic archived. No new replies allowed.