making a each letter of a word different colors

I simply want the user to type a word and then the output is the word they typed with each letter a different color. I am not sure how do go about this though. I am using #include <windows.h>.
Last edited on
In C++ a word is the string data type. You can print out the individual characters of a string by using a for loop, i = 0 and i < yourString.length() and cout'ing the character like an array youString[i] but you also need the <string> header file. Before you cout the character, you can change your color there as well.

Hope this will guide you into the right direction.
Topic archived. No new replies allowed.