The simplest way you can do is:
#include <stdlib.h>
system("Color F3");
Where "F" is the code for the background color and 3 is the code for the text color.
Mess around with it to see other color combinations:
system("Color 1A");
std::cout << "Hello, what is your name?" << std::endl;
system("Color 3B");
std::cout << "Hello, what is your name?" << std::endl;
system("Color 4c");
std::cout << "Hello, what is your name?" << std::endl;
Note: I only tested on Windows. Works. As pointed out, this is not cross-platform, it will not work on Linux systems.