저는 C를 배우고 기능 장을 연습하고 있습니다. 그래서 저는 3 개의 파일과 2 개의 작은 함수로 구성된 작은 프로그램을 작성했습니다. 진실하게 그것은 작동하지 않는다. 오류가 없으며 함수가 단순히 실행되지 않고 이유를 모르겠습니다.C.를 사용하여 함수를 사용한 프로그래밍 기능이 실행되지 않았습니다.
우선이 기능은 내 기능 만 선언하는 내 헤더 파일입니다.
//employee.h
int addEmployee(void);
int printEmployee(int i);
다음 파일은 함수를 정의한 것입니다.
//employee.c
#include "employee.h"
#include <stdio.h>
#include <ctype.h>
int numE;
int i;
int addEmployee(void)
{
printf("Please type in the number of your employees: ");
scanf_s("%d", &numE);
i = numE;
return i;
}
int printEmployee(int i)
{
printf("%d", i);
getchar();
getchar();
return i;
}
그리고 마지막 파일이 기능을 실행하는 데 사용됩니다.
//lab6.c
#include "employee.h"
#include <stdio.h>
#include <ctype.h>
int main()
{
int addEmployee();
int printEmployee();
return 0;
}
출력으로 무엇을 얻습니까? –