C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[12304] Re:에러 하나 좀 잡아주세요
개박살.U&I [inutero] 698 읽음    2001-11-03 14:49

안녕하세요? 개박살입니다.

일단 에러는 잡았습니다. 그거 말고도 여러군데 버그가 있군요 ^^;

그럼 열씨미 하세요~

그에러는 세미콜론을 안찍어서 발생한 에러입니다.

float average(int total);   /*평균값 avg함수의 선언 */

여기서 끝에 세미콜론을 안찍으셨더군요 그럼

PS. 프로그램은 혼자 생각하면서 자신의 손으로 해내야 실력이 늘죠!!
    이것저것 해보다가 도저히 모르겠으면 여기에 질문해보세요~


struct score    {
    char name[10];
    char no[4];
    int kor;
    int eng;
    int math;
    int total;
    float avg;
};
struct score st[10];        /*구조체 변수 st 선언*/

float average(int total);   /*평균값 avg함수의 선언 */

void main()
{
    int i;
    int total;
    float avg;
    for(i=0; i<10; i++) {
        printf("\n enter name, no and score orderly manner");
        printf("\n input student name");
        scanf("%s",st[i].name);
        printf("\n input his(her) number");
        scanf("%s",st[i].no);
        printf("\n input his(her) korean score");
        scanf("%d",st[i].kor);
        printf("\n input his(her) english score");
        scanf("%d",st[i].eng);
        printf("\n input his(her) mathematic score");
        scanf("%d",st[i].math);
    }

    st[i].total=st[i].kor+st[i].eng+st[i].math;

    avg=average(st[i].total);            /*호출함수로 실매개변수 사용 */
    scanf("%f",st[i].avg);

    printf("\n\n");
    for(i=0; i<10; i++) {
        printf("학번 이름 국어 영어 수학 평균 \n");
        printf("%-8s%-8s%4d%4d%4d%4f\n",st[i].name,st[i].no,st[i].kor,st[i].eng,st[i].math,st[i].avg);
    }

}

float average(int total)       /*평균값 avg함수의 정의*/
{
    return ((total)/3);
}

+ -

관련 글 리스트
12301 에러 하나 좀 잡아주세요 김진훈 698 2001/11/03
12304     Re:에러 하나 좀 잡아주세요 개박살.U&I 698 2001/11/03
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.