小工具知识网

当前位置: 首页 > 行业知识 > c++编译报错:xxx was not declared in this scope

行业知识

c++编译报错:xxx was not declared in this scope

2026-10-29 06:33:34 来源:互联网转载

index.php/tags-41973.html" >���本原因:变量、函数、或者类未声明或者定义。

()

实际原因:被调用的代码,写在调用处的下面了,比如:

void funcA(){funcB();// do something}void funcB(){// do something}

这就会报错:funcB was not declared in this scope.

()

挪一下位置就好了:

void funcB(){// do something}void funcA(){funcB();// do something}

编译通过。

上一篇:轻松掌握上午英语表达秘诀,提升语言交流能力!

下一篇:域名怎么找回?