的main.c中會是這個樣子:
// bring in the prototypes and typedefs defined in 'another'
#include "another.h"
int main(int argc, char *argv[])
{
int some_value = 1;
// call a function that is implemented in 'another'
some_another_function(some_value);
some_another_function1(some_value);
return 1;
}
的another.h應包含another.c文件中找到的類型定義和功能函數原型:
// add your typdefs here
// all the prototypes of public functions found in another.c file
some_another_function(int some_value);
some_another_function1(int some_value);
的another.c應包含another.h找到的所有函數原型的功能實現:
// the implementation of the some_another_function
void some_another_function(int some_value)
{
//....
}
// the implementation of the some_another_function1
void some_another_function1(int some_value)
{
//....
}
你的意思是'#include'?聽起來你應該在課堂上多聽! – John3136
她從來沒有在課堂上講過,實驗室的TA拒絕幫助我,因爲我不想學習如何在Linux中編寫代碼。我試過#include another.c沒有工作,我嘗試了gcc another.c –
那麼爲什麼你用「so」開始語句?那麼你爲什麼不把句子的第一個字母和「我」的大寫?所以請至少和潛在的僱主一樣對待我們。 –