我正在從PHP切換到C++,並且我有這個問題。如何使用頭文件
我有 main.cpp,true.cpp,false.cpp和header.h。
的header.h有一個函數 「Function_go_to_requested_page.cpp()」
main.cpp中看起來像這樣
#include header.h
bool x;
cin>>x;
Function_go_to_requested_page(x) // It should take to page true.cpp if x=1 else to false.cpp
我不`噸知道如何定義在頭文件中此功能,我將在true.cpp和false.cpp中調用這個函數。
謝謝你的時間。
我會說,沒有研究工作。 – lapk
根據你最後兩個問題,我建議你從一本好的C++書開始:[The Definitive C++ Book Guide and List](http://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and -list) – Blastfurnace
對我來說聽起來像是一個家庭作業問題,請嘗試使用C++書或C書或Google。 – bizzehdee