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

C/C++ Q/A
[4719] 에러날일이 없는데 왜 날까요..답변부탁드립니다
김동훈 [drinamyl] 1132 읽음    2004-10-28 09:44
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

struct test{
    char title[20];
    char total[3];
    } ;

int main ()
{
    struct test st[5]= {
    {"kim2", "100"},
    {"dong", "60"},
    {"hoon", "70"},
    {"soo1", "100"},
    {"soo2", "80"}
    };

  //    printf("%s__%d", st[1].title, st[1].total);
    int i, j;
    struct test sttemp;
  //    char temp2[5];
        for(i=0; i<=5-1; i++){
            for(j=i+1; j<=5; j++) {
               
                if( atoi(st[i].total) > atoi(st[j].total) ) {
                        sttemp = st[i];
                        st[i] = st[j];
                        st[j] = sttemp;
                    }

                    }
                    }

        for(i=0; i<=4; i++){
        printf("%s__%d\n", st[i].title, atoi(st[i].total) );
        }

  return 0;
}

컴파일 후 실행하면 general protection exception 이라고 나네요
답변 부탁드립니다 감사합니다

+ -

관련 글 리스트
4719 에러날일이 없는데 왜 날까요..답변부탁드립니다 김동훈 1132 2004/10/28
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.