扫地僧与茶 2016-03-04 14:19 采纳率: 33.3%
浏览 1715
已采纳

一个关于C++源程序关键字统计的问题

为什么是char类型
char KeyWord[Total][MaxLength]是什么意思

const int Total=63; //
const int MaxLength=20;

char KeyWords[Total][MaxLength] //列举关键字
{
"asm","auto","bool","break","case",
"catch","char","class","const","const_cast",
"continue","default","delete","do","double",
"dynamic_cast","else","enum","explicit","export",
"extern","false","float","for","friend",
"goto","if","inline","int","long",
"mutable","namespace","new","operator","private",
"protected","public","register","reinteroret_cast","return",
"short","signed","sizeof","static","static_cast",
"struct","switch","template","this","throw",
"true","try","typedef","typeid","typename",
"union","unsigned","using","virtual","void",
"volatile","wchar_t","while",
};

  • 写回答

1条回答 默认 最新

  • u52983610 2016-03-04 14:26
    关注

    你把char [Total][MaxLenght]想成string [Total]就行了,这个二维数组,每一行是一个char数组,就是一个string,每一行的每一列都是一个字母,
    比如第一行是'a','s','m',第二行是'a','u','t','o',一共63行,也就是63个关键字,每个关键字最长20个字符

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 iOS绕地区网络检测
  • ¥15 python验证码滑块图像识别
  • ¥15 根据背景及设计要求撰写设计报告
  • ¥15 QT6颜色选择对话框显示不完整
  • ¥20 能提供一下思路或者代码吗
  • ¥15 用twincat控制!
  • ¥15 请问一下这个运行结果是怎么来的
  • ¥15 单通道放大电路的工作原理
  • ¥30 YOLO检测微调结果p为1
  • ¥15 DS18B20内部ADC模数转换器