[英]Atom header files c++
我是C ++和編碼方面的新手,感謝您的幫助! 因此,我使用的是Atom,當我嘗試在源程序中包含頭文件時,似乎無法識別它。 這是我嘗試運行的一個非常簡單的程序:
我的源文件:
#include <iostream>
#include "file.h"
using namespace std;
int main() {
opa();
return 0;
}
我的頭文件(file.h):
#ifndef FILE_H_
#define FILE_H_
void opa() {
cout << "Numerai" << endl;
}
#endif
我在編譯時遇到的錯誤是:在此范圍內未聲明'opa'。 知道有什么錯誤嗎?
元命令的文件搜索順序
#include "file.h"
將會
如果用戶未提供包含文件的位置,則編譯器可能會使用平台特定的“ file.h”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.