멀티파일 하는방법을 모르겠어요

ch0249의 이미지

안녕하세요. 소스파일 하나를 프로젝트로 멀티파일하라고 하는데 제가 비전공자로
석사를 하게되서 구글링하며 겨우하고 있는데 멀티파일은 개념부터가 잘 안생기더라고요.
밑에 파일 어떻게는 컴파일링 하려고했는데 3일째 못하고 질문드립니다. 제발 도와주세요~~~ㅜㅜ 부탁드려요,
소스 밑에 저장했어요

헤더파일
#include
#include
#include
#include
#include "functions.c"

extern long int total; /*global, data*/
extern int countservice;

extern void sendParcel(total,countservice);
extern void sendMail(total,countservice);
extern void sellStamps(total,countservice);
extern void exchangeMoney(total,countservice);

메인파일
#include "header.h"

int main()
{
int menu; /*automatic, stack*/
int restart=1;
printf("\n\t\t****************************************");
printf("\n\t\t------POST OFFICE MANAGEMENT SYSTEM-----");
printf("\n\t\t****************************************");

Sleep(2000);

do
{
printf("\n 1 : Courier service");
printf("\n 2 : Postal service");
printf("\n 3 : Stamp sales");
printf("\n 4 : Exchange service");
printf("\n 5 : Exit\n");

scanf("%d",&menu); /*Input number service you want*/
system("cls");

while(menu >= 6 || menu <= 0)
{ printf("\n 1 : Courier service");
printf("\n 2 : Postal service");
printf("\n 3 : Stamp sales");
printf("\n 4 : Exchange service");
printf("\n 5 : Exit\n");
printf("Please select again");
scanf("%d",&menu);
MessageBox(0,"Invalid Number!\nEnter Again","Error!",0);
}

switch(menu)
{
case 1 :
printf("\n\t************************************");
printf("\n\tWe will guide you by courier service.");
printf("\n\t************************************");
Sleep(2000);
system("cls");
countservice++;
sendParcel(total,countservice);
break;
case 2 :
printf("\n\t************************************");
printf("\n\tI will help you with postal services.");
printf("\n\t************************************");
Sleep(2000);
system("cls");
countservice++;
sendMail(total,countservice);
break;
case 3 :
printf("\n\t***********************");
printf("\n\tWe sell various stamps.");
printf("\n\t***********************");
Sleep(2000);
system("cls");
countservice++;
sellStamps(total,countservice);
break;
case 4 :
printf("\n\t*********************************************");
printf("\n\tWe will help you with your exchange business.");
printf("\n\t*********************************************");
Sleep(2000);
system("cls");
countservice++;
exchangeMoney(total,countservice);
break;
case 5 :
printf("\n\t**********");
printf("\n\tGood bye~~.");
printf("\n\t**********");
getch();
exit(0);
}

system("cls");
printf("\n\t*******************************");
printf("\n\tCan I help you further?(Y=1,N=0)");
printf("\n\t********************************\n");
scanf("%d",&restart);

}while(restart==1);

printf("\n\t********************************");
printf("\n\tThank you for using our service.");
printf("\n\t********************************");

return 0;
}

function 파일
void sendParcel(total,countservice)
{
int overseas; /*local, stack*/
int fee;
int weight;
int result;
printf("\n\n\nAre you sending it overseas?(Y=1,N=0)");
scanf("%d",&overseas);

while(overseas >= 2 || overseas < 0)
{
printf("Please select again");
scanf("%d",&overseas);
}

if(overseas==1)
{
int continent;
printf("\nWhich continent do you send to?");
printf("\n1.ASIA\n2.AMERICA\n3.EUROPE\n4.AFRICA\n5.ACEANIA\n");
scanf("%d",&continent);

switch(continent)
{
case 1 : printf("\n\t*******************************");
printf("\n\tThe rate is 1000 rupees per kg.");
printf("\n\t*******************************");
fee = 1000;
break;
case 2 : printf("\n\t*******************************");
printf("\n\tThe rate is 1200 rupees per kg.");
printf("\n\t*******************************");
fee = 1200;
break;
case 3 : printf("\n\t*******************************");
printf("\n\tThe rate is 1800 rupees per kg.");
printf("\n\t*******************************");
fee = 1800;
break;
case 4 : printf("\n\t*******************************");
printf("\n\tThe rate is 1500 rupees per kg.");
printf("\n\t*******************************");
fee = 1500;
break;
case 5 : printf("\n\t*******************************");
printf("\n\tThe rate is 1300 rupees per kg.");
printf("\n\t*******************************");
fee = 1300;
break;
}
}
else
{
printf("\n\t***************************************************");
printf("\n\tDomestic is 400 rupees per kg regardless of region.");
printf("\n\t***************************************************");
fee = 400;
}
Sleep(2000);
system("cls");

printf("\nWhat is the weight of your parcel?\n");
scanf("%d",&weight);

result = weight*fee;
total = total+result;

printf("\n\t\t***********************");
printf("\n\t\tThe courier fee is Rs %d.",result);
printf("\n\t\t***********************");

printf("\n\n\t\t******************************");
printf("\n\t\tYou have used all %d services.",countservice);
printf("\n\t\t******************************");
printf("\n\n\t\t************************");
printf("\n\t\tThe Total cost is Rs %d.",total);
printf("\n\t\t************************");

getch();

}

void sendMail(total,countservice)
{
int overseas; /*automatic, stack*/
int fee;
int result;
int letter;
printf("\n\n\nAre you sending it overseas?(Y=1,N=0)");
scanf("%d",&overseas);

while(overseas >= 2 || overseas < 0)
{
printf("Please select again");
scanf("%d",&overseas);
}

switch(overseas)
{
case 0 : printf("\n\t****************************");
printf("\n\tDomestic mail is 300 rupees.");
printf("\n\t****************************");
fee = 50;
break;
case 1 : printf("\n\t*********************************");
printf("\n\tInternational mail is 300 rupees.");
printf("\n\t*********************************");
fee = 300;
break;
}
Sleep(2000);
system("cls");

printf("\nHow many letters?\n");
scanf("%d",&letter);

result = letter*fee;

printf("\n\t\t***********************");
printf("\n\t\tThe letter fee is Rs %d.",result);
printf("\n\t\t***********************");

total = total+result;
printf("\n\n\t\t******************************");
printf("\n\t\tYou have used all %d services.",countservice);
printf("\n\t\t******************************");
printf("\n\n\t\t************************");
printf("\n\t\tThe Total cost is Rs %d.",total);
printf("\n\t\t************************");

getch();
}

void sellStamps(total,countservice)
{
int result;

total = total+result;
printf("\n\n\t\t******************************");
printf("\n\t\tYou have used all %d services.",countservice);
printf("\n\t\t******************************");
printf("\n\n\t\t************************");
printf("\n\t\tThe Total cost is Rs %d.",total);
printf("\n\t\t************************");
getch();
}

void exchangeMoney(total,countservice)
{
int country;
float exchangeratio;
char unit1;
char unit2;
char unit3;
int foreignmoney;
int result;
printf("Which country money do you want to exchange?(1.Korea 2.USA 3.EU 4.China)\n");
scanf("%d",&country);
while(country>=5 || country<=0)
{
printf("Please select again");
scanf("%d",&country);
}

switch(country)
{
case 1 : printf("\n\t*******************************************************");
printf("\n\tThe ratio of Korean wons to Indian rupees is 0.061 to 1.");
printf("\n\t*******************************************************");
exchangeratio = 0.061;
unit1 = 'K';
unit2 = 'R';
unit3 = 'W';
break;
case 2 : printf("\n\t******************************************************");
printf("\n\tThe ratio of US dollars to Indian rupees is 68.7 to 1.");
printf("\n\t******************************************************");
exchangeratio = 68.7;
unit1 = 'U';
unit2 = 'S';
unit3 = 'D';
break;
case 3 : printf("\n\t******************************************************");
printf("\n\tThe ratio of EU euros to Indian rupees is 79.9 to 1.");
printf("\n\t******************************************************");
exchangeratio = 79.9;
unit1 = 'E';
unit2 = 'U';
unit3 = 'R';
break;
case 4 : printf("\n\t******************************************************");
printf("\n\tThe ratio of Chinese Yuans to Indian rupees is 10.32 to 1.");
printf("\n\t******************************************************");
exchangeratio = 10.32;
unit1 = 'C';
unit2 = 'N';
unit3 = 'Y';
break;
}
printf("\nExchange ratio is %.3f\n",exchangeratio);
printf("\nHow much %c%c%c do you need?\n",unit1,unit2,unit3);
scanf("%d",&foreignmoney);

result = foreignmoney*exchangeratio;
printf("%d is required depending on the exchange rate.\n", result);

total = total+result;
printf("\n\n\t\t******************************");
printf("\n\t\tYou have used all %d services.",countservice);
printf("\n\t\t******************************");
printf("\n\n\t\t************************");
printf("\n\t\tThe Total cost is Rs %d.",total);
printf("\n\t\t************************");
getch();
}

File attachments: 
첨부파일 크기
Package icon main.zip3.1 KB
세벌의 이미지

kldp에 글 쓸 때 소스 코드 넣으려면
https://kldp.org/node/158191
참고하셔요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.