2024年6月5日发(作者:)

1) error C2374: 'x' : redefinition; multiple initialization

see declaration of 'x'

意思为:变量x被重复定义;如下图所示;

2) error C2065: 'y' : undeclared identifier

错误原因:变量y为被定义

这就涉及到变量的作用域问题,在复合语句中

定义的变量y,只在其第一个复合语句y内有效。

3) error C2065: 'strlen' : undeclared identifier

错误原因;没有包含字符串的头文件:#include

4) warning C4101: 'a' : unreferenced local variable

警告原因:局部变量a只被定义而未被引用。

5) error C2166: l-value specifies const object

错误原因:不可通过指向常量的指针变量修改其指向的对象的值。