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

C/C++ Q/A
[1236] 왜 에러가 나나여??
선녀 [q12w34e] 1535 읽음    2002-09-23 10:19
**.c 하고 **.cpp 하고 다른 가봐여..
똑같은 소스를 c로 저장해서 컴파일 하면 에러가 나고 cpp로 저장하면 에러 없이 잘 돌아가니..
이 소스가 그렇던데.. 왜 그런지..설명좀 부탁해여..

Declaration is not allowed here
Declaration is not allowed here
Declaration is not allowed here

이렇게 에러 코드가 나오네여..

#include <stdio.h>
#include <conio.h>
void main(void)
{
    clrscr();
    char *name,*num;                <-----------   여기서.에러
    int kor,eng,math,sci,phy;       <-------------  여기서에러
    float total1,total2,avg1,avg2;   <---------  여기서 에러
    gotoxy(40,5);    printf("score");
    gotoxy(23,7);   printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");
    gotoxy(25,9);
    printf("input name : ");    scanf("%s",name);
    gotoxy(25,10);
    printf("input number : ");         scanf("%s",num);
    gotoxy(16,11);
    printf("input First kor, eng, math, sci, phy :");
    scanf("%d %d %d %d %d",&kor,&eng,&math,&sci,&phy);
    total1=kor+eng+math+sci+phy;
    avg1=total1/5;
    gotoxy(16,12);
    printf("input Second kor, eng, math, sci, phy :");
    scanf("%d %d %d %d %d",&kor,&eng,&math,&sci,&phy);
    total2=kor+eng+math+sci+phy;
    avg2=total2/5;
    gotoxy(23,14);  printf("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~");

    gotoxy(25,15);
    printf("name : %s\t",name);    printf("number : %s\n",num);
    gotoxy(25,16);
    printf("First total : %.0f , average : %.2f",total1,avg1);
    gotoxy(25,17);
    printf("Second total : %.0f , average : %.2f",total2,avg2);
    gotoxy(23,19);
    printf("=======================================");
    gotoxy(25,21);
    printf("total sum : %.0f , average : %.2f",total1+total2,(avg1+avg2)/2);
    getch();
}



+ -

관련 글 리스트
1236 왜 에러가 나나여?? 선녀 1535 2002/09/23
1239     Re:왜 에러가 나나여?? 남병철.레조 1635 2002/09/23
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.