Loading... 经常忘记先放在这 ![image.png](http://www.irohane.top/usr/uploads/2021/02/1020221680.png) 如上图所示 ,在一个类中 .h 中 声明一个句柄 。CPP中对这个句柄复制。然后其他文件只需要引用 .h 即可 --- ### 命名空间 得益于命名空间的使用在导入函数的时候,可以使用不同空间的,相同名称的函数。 空间一: ../Hello/func1.cpp->func hello(); 在func1中有一个hello()函数 空间二:../Hello/func2.cpp->func hello(); 在func2中有一个hello()函数 在需要的空间中声明其中一个的作用域使用即可、 和python的封包差不多。把文件当成类使用什么就直接点出来即可【格式限制】 最后修改:2021 年 03 月 10 日 © 允许规范转载 赞 0 如果觉得我的文章对你有用,请随意赞赏