我正在尝试制作一个程序来打印数组的名称,该数组代表棋盘的第一行。我的尝试是使用以下程序,但我唯一能实现的是打印数字:(。
#include <iostream>
using namespace std;
void main()
enum pions // giving the names in pions
{
Tower=1 ,
Horse ,
Officer ,
Princes ,
King };
int Chess [0][8]={Tower , Horse , officer , Princes , King , Officer , Horse , Tower };
// putting the names of each coordinate in the array (above ) .
cout << " in this place the pion that is placed is the " << chess [0][1] << endl;
我知道程序会打印数字 2 ,但我怎样才能让它打印单词“Horse”而不是 2 ???
cout 命令是由程序的创建者(我:P)编写的,我如何为用户提供选择要打印的数组部分的选项?
提前感谢您的时间和精力,如果我不清楚,非常抱歉,这是我的第一篇文章:D。
欢迎任何建议。