如题所示,为什么字符串加了const
就会报错,去掉const
就能过?
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int main()
{
const char letter[] = "`1234567890-=QWERTYUIOP[]\\ASDFGHJKL;'ZXCVBNM,./";
cout<<strlen(letter)<<endl;
return 0;
}