我想解决this问题,我得到这样一个错误[从'字符'无效转换''常量字符'],但我无法弄清楚如何解决它。下面是线,其中所述问题是:C++无效转换从
Declarations:
string alp("ABCDEFGHIJKLMNOPQRSTUVWXYZ");
string formatted;
char partoftext[20];
size_t found;
found = text.copy(partoftext,2,0);
partoftext[found] = '\0';
a = atoi(partoftext);
formatted.append(alp[a]);
...
,问题是在这行代码:
formatted.append(alp[a]);
感谢。
你不给足够的上下文。什么是格式化的?什么是错误?什么是? – 2012-04-16 07:26:53
如何声明'formatted'? – dschulz 2012-04-16 07:27:19
我编辑过。对不起大家。 – ddacot 2012-04-16 07:30:54