게시판 즐겨찾기
편집
드래그 앤 드롭으로
즐겨찾기 아이콘 위치 수정이 가능합니다.
c고수님들 도와주세요 ㅠㅠ
게시물ID : freeboard_314116짧은주소 복사하기
작성자 : 『Rain』...
추천 : 1
조회수 : 350회
댓글수 : 4개
등록시간 : 2008/09/20 21:31:06
#include <stdio.h>
#include <math.h>
#define PI 3.14159
#define e0 (8.854e-12)

struct source{
double sourceX;
double sourceY;
double sourceZ;
};
struct test{
double sourceQ;
double testX;
double testY;
double testZ;
};


double do_Input(struct source* src, struct test* t);
double do_Figure(struct source* src, struct test* t);

void main(void)
{
struct source src[2];
struct test t;

do_Input(src,t);
do_Figure(src,t);

return;
}

double do_Input(struct source* src, struct test* t)
{
int i;

printf("Source의 크기를 입력하세요.\n");
scanf("%f", &t[0].sourceQ);

for(i=0; i<2; i++)
{
printf("SourceX %d의 좌표를 입력하세요.\n",i+1);
scanf("%f", &src[i].sourceX);
printf("SourceX %d의 좌표를 입력하세요.\n",i+1);
scanf("%f", &src[i].sourceY);
printf("SourceX %d의 좌표를 입력하세요.\n",i+1);
scanf("%f", &src[i].sourceZ);

}

printf("Test SourceX,Y,Z 를 입력하세요.\n");
scanf("%f %f %f", &t[0].testX, &t[0].testY, &t[0].testZ);

return;
}

double do_Figure(struct source* src, struct test* t)
{
double E, R, aR;
int i;





}

과제때문에 소스를 짜는중입니다.. 아직 완성된건 아니구요.

구조체를 포인터를 이용해서  do_Input함수로 넘겨줄라고 하는데요..

Compiling...
main.c
C:\Program Files\Microsoft Visual Studio\MyProjects\home\main.c(27) : error C2115: 'function' : incompatible types
C:\Program Files\Microsoft Visual Studio\MyProjects\home\main.c(27) : warning C4024: 'do_Input' : different types for formal and actual parameter 2
C:\Program Files\Microsoft Visual Studio\MyProjects\home\main.c(28) : error C2115: 'function' : incompatible types
C:\Program Files\Microsoft Visual Studio\MyProjects\home\main.c(28) : warning C4024: 'do_Figure' : different types for formal and actual parameter 2
C:\Program Files\Microsoft Visual Studio\MyProjects\home\main.c(54) : warning C4033: 'do_Input' must return a value
Error executing cl.exe.

home.exe - 2 error(s), 3 warning(s)

이런 에러가 뜨네요.. 타입이 다르하고하는데 어느부분의 타입이 안맞는건가요??

그리고 return값을 어떻게 지정해줘야되죠??

좀 도와주세요 ㅠㅠ
꼬릿말 보기
전체 추천리스트 보기
새로운 댓글이 없습니다.
새로운 댓글 확인하기
글쓰기
◀뒤로가기
PC버전
맨위로▲
공지 운영 자료창고 청소년보호