Color
не является ни одной строкой, это массив строк, поэтому вам нужно сделать цикл для печати каждого из них. Кроме того, вам нужно найти хорошее место, чтобы узнать C++, потому что вещи, которые вы делаете из C.
<string.h>
для строк C, <string>
для C++ станд :: строка
'\0'
в конце массива также является веществом C.
const char * pointers[] = {"HELLO","WORD", '\0' }; // the third element is a NULL pointer (in C++11 now you can use nullptr)
int i = 0;
while (pointers[i] != nullptr)
std::cout << pointers[i++];
Demo
#include <iostream>
#include <string>
using namespace std;
int main() {
// You don't need to specify the size, the compiler can calculate it for you.
// Also: a single string needs a '\0' terminator. An array doesn't.
string Color[] = { "Red", "Blue", "Green", "Purple", "Yellow",
"Black", "White", "Orange", "Brown"};
for (const auto& s : Color) // There's multiple ways to loop trought an array. Currently, this is the one everyone loves.
cout << s << '\t'; // I'm guessing you want them right next to eachother ('\t' is for TAB)
// In the loop &s is a direct reference to the string stored in the array.
// If you modify s, your array will be modified as well.
// That's why if you are not going to modify s, it's a good practice to make it const.
cout << endl; // endl adds a new line
for (int i = 0; i < sizeof(Color)/sizeof(string); i++) // Old way.
cout << Color[i] << '\t';
cout << endl;
for (int i = 3; i < 6; i++) // Sometimes u just want to loop trough X elements
cout << Color[i] << '\t';
cout << endl;
return 0;
}