The way I'd approach it is like this:
1. Define functions that return random voewls and random consonants - here's a random vowel function:
char RandomVowel()<br />{<br /> const char vowels[] = {'a', 'e', 'i', 'o', 'u'};<br />
2. Build up a string using alternating calls to the random vowel and consonant functions - note that I've remembered about the upper case first character!
std::string name;<br /> name += (char)toupper(RandomConsonant());<br /> for(int i=1;i<desired-name-length;++i)<br /> {<br /> if (i%2==1)<br /> name += RandomVowel();<br /> else<br /> name += RandomConsonant();<br /> }
Obviously the desired name length should be chosen at random as well!