[C++] 定义数组不能像Java一样方括号两边都能放

int main(){
	char []a = "haha";//error
	return 0;
}

error: decomposition declaration cannot be declared with type 'char'
error: empty decomposition declaration

只能是

char a[]="haha";
posted @ 2018-08-14 14:56  zengzhaocheng  阅读(857)  评论(0编辑  收藏  举报