조금길지만 value ,reference, name 에 대해 질문할께요.
적송
안녕하세요 씨언어 공부하다가 call by 의 호출 함수로 코드를 짜봤는데. 각각의 컴파일을 돌렸을 때 에러는 뜨지 안씁니다.그런데 전체 컴파일을 돌리면 제가 부여한 input process 함수가 undefined reference 가 뜨네요... 링크 에러라고.. 제가 짠거 중에 이 컴파일을 제외한 나머지부분이 어떻게 틀렸는지 알고 싶습니다.. ㅜㅜㅜ#include stdio.h
#include stdlib.h#define SIZE 7
#define UPPER 100.0
#define LOWER 60.0float data[SIZE];int main(int argc, char *argv[])
{
void input(void);
float process(float *max, float *min,float *score);
void write(float, float, float, float); float total = 0.0, max = 0.0, min = UPPER;
float score; input(); //call by name total = process(&max, &min, &score); //call by reference write(max, min, total, score); //call by value
system(PAUSE);
return 0;
}
-------------------------------------------여기까지가 main함수입니다.#include stdio.hextern float data[];void input(void)
{
int man;
int SIZE;
int LOWER;
int UPPER; printf(\n\t\t 체조 경기장의 점수 산정 프로그램);
man = 0;
while (man SIZE)
{
printf(\n\t\t\t 제 %d 채점관 : , man + 1 );
scanf(%.f, &data[man]);
if (data[man] = LOWER && data[man] = UPPER)
man++;
else printf(ERROR : 점수는 60점 - 100점 사이 \a\a\a\n);
}
}--------------------------input gcm 함수입니다.#include stdio.hextern float data[];
float process(float *max, float *min,float *score)
{
int total;
int man;
int SIZE; for(man = 0; man SIZE; man++)
total += data[man];
for(man = 0; man SIZE; ++man)
{
if (*max data[man])
*max = data[man];
if (*min data[man])
*min = data[man];
}
total = total - (*max + *min);
*score = (float) total / (SIZE - 2);
for (man = 0; man SIZE; man++) return(total);
}
---------------------------------- process 입니다.#include stdio.h
extern float data[];
void write(float max, float min, float total, float score)
{
int man; printf(\n\t %d 채점관 = %.2f, man + 1, data[man]);
printf(\n\t 최고 점수 : %.2f, max);
printf(\n\t 최하 점수 : %.2f, min);
printf(\n\t 점수 총계 : %.2f, total);
printf(\n\t 평 균 : %.2f, score);
}--------------------------------- 마지막 결과 출력하는 곳이구요.죄송하게도 코트가 깁니다. 꼭 알고싶어요..ㅜㅜㅜ 오류의 정황..
-
파도
하나의 프로젝트로 되어 있구요 ㅜㅜ
교재는 C언어 실천하기 입니다 ㅜㅜ -
라온제나
이상하군요. 모든 소스코드파일이 하나의 프로젝트에 등록되어 있나요?
그런데 한가지 궁금한게 있는데요. 교재로 사용하는 책의 이름이 무언가요?
전에도 이것과 같은 소스코드인데 C가 지원하지 않는
\call by name\과 \call by reference\를 사용했다는 주석을 달아두었던 것을 본 일이 있어서 말입니다.
번호 | 제 목 | 글쓴이 | 날짜 |
---|---|---|---|
2695766 | 달팽이 배열 어디서 틀렸는지 모르겠습니다ㅠㅠ | 연분홍 | 2025-05-23 |
2695738 | fopen과fclose질문~~ (5) | 희선 | 2025-05-23 |
2695707 | 3의 배수 나타내기. (2) | 수리 | 2025-05-23 |
2695626 | 피보나치수열 과제 때문에 질문 드립니다. (6) | 옆집언니 | 2025-05-22 |
2695595 | 포인트공부중입니다 int형에서 4=1 인가요? (3) | 족장 | 2025-05-22 |
2695567 | 드라이브 고유번호를 가져오는 함수 (2) | 초코맛사탕 | 2025-05-21 |
2695533 | 음수의 산술변환! 질문이요 ㅠㅠ... (4) | 꽃여름 | 2025-05-21 |
2695506 | 구조체 배열 이용 도서목록 출력 프로그램 (1) | 가을귀 | 2025-05-21 |
2695450 | c언어 함수 질문이요.... | 이슬비 | 2025-05-20 |
2695403 | VirtualAlloc함수 및 메모리 질문 | 크리에이터 | 2025-05-20 |
2695355 | c언어 for함수 | 미쿡 | 2025-05-19 |
2695327 | 안녕하세요 제가 이번에 좀 큰 프로그램을.. | 악당 | 2025-05-19 |
2695295 | mutex동기화의 thread기반 채팅 서버소스 질문입니다 | 그루터기 | 2025-05-19 |
2695270 | 질문이요..swap 관한겁니다..ㅠㅠ (3) | 콩알녀 | 2025-05-19 |
2695244 | 노땅초보궁금한게 하나 있는데요..반복문(while문)초보자질문 (6) | 큰꽃늘 | 2025-05-18 |
2695166 | do while 문 어떤것이잘못된건지 모르겠어요 (2) | 아이폰 | 2025-05-18 |
2695122 | 구조체에 대해 물어보고 싶은게 있습니다 ^^^.. (7) | 수련 | 2025-05-17 |
2695091 | txt 파일 입출력 후 2차 배열에 저장하기입니다. (3) | 헛장사 | 2025-05-17 |
2695063 | 수도요금 프로그램좀 짜주세요. | 시내 | 2025-05-17 |
2695033 | 답변좀요ㅠㅠ (1) | 비사벌 | 2025-05-16 |