[問題] 程式模組化基本例題...
( *[1m *[m 為色碼,可以按 Ctrl+V 預覽會顯示的顏色 )
( 未必需要依照此格式,文章條理清楚即可 )
遇到的問題: (題意請描述清楚)
將以下程式分存於兩個不同的檔案來編譯
/*prog8_1, 簡單的函數範例*/
#include <stdio.h>
#include <stdlib.h>
void star(void); /*函數原型的宣告必須以分號結尾*/
int main(void)
{
star();
printf("歡迎使用c語言\n");
star();
system("pause");
return 0;
}
void star(void)
{
printf("*************\n");
}
--
//我的main.c
#include <stdio.h>
#include <stdlib.h>
void star(void); /*函數原型的宣告必須以分號結尾*/
int main(void)
{
star();
printf("歡迎使用c語言\n");
star();
system("pause");
return 0;
}
//我的star.c
#include <stdio.h>
void star(void)
{
printf("*************\n");
}
--
按下編譯的結果出現錯誤!!
"Could not creat Makefile: c:\dev-cpp\...... "
請問哪裡出錯了呢??
希望得到的正確結果:
程式跑出來的錯誤結果:
開發平台: (例: VC++ or gcc/g++ or Dev-C++, Windows or Linux)
有問題的code: (請善用置底文標色功能)
補充說明:
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.38.121.90
推
07/13 00:05, , 1F
07/13 00:05, 1F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章