有没有一种方法可以在 Eclipse for C++ 中使用 cpp 文件创建一个没有头文件的类?另外,有没有办法运行单个文件,而不将其放入自己的项目或其他东西中?我在网上搜索,但找不到完全按问题回答的答案。
最佳答案
回复:
Is there a way to create a class with a cpp file in Eclipse for C++ without the header?
是的。您可以将类定义和元素函数的实现放在同一个 .cpp
文件中。
回复:
[...] is there a way to run a single file, without putting it in its own project or something?
- 选择运行 → 外部工具 → 外部工具配置...
- 选择新建按钮或右键单击 → 新建
- ...配置...
- 停用构建 → 启动前构建,以防您不想
关于c++ - Eclipse C++ 头文件和文件问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47490717/