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
[70152] 안녕하세요 c언어 오류 아무리고민해봐도모르겠습니다 ㅠㅠ
C언어학도 [] 3226 읽음    2013-09-24 20:33
c언어에서 "Unhandled exception~: Access Violation." 오류

아무리고민해봐도 왜 이오류가나오는지 이유를 잘모르겠습니다;



도와주세요 ㅠㅠ





#include <stdio.h>
#include <Windows.h>
#include <math.h>


int main(void){
unsigned int time_start;
unsigned int time_end;
unsigned int time_true;







  int *count;
  int c,d,e,i,j,t,k,n,m,z,answer = 0;

  int a[25000];
  int b[25000];

  FILE * in;
  FILE * out;
  in = fopen("C:\\input.txt", "r");
  out = fopen("C:\\output.txt", "w");

  time_start = GetTickCount();

  fscanf(in, "%d %d", &n, &k);
  count = (int*)calloc(n, sizeof(int));



  for(c=0, d=0 ; c,d<k ; c++,d++){
   fscanf(in, "%d %d" , &a[c], &b[d]);
  }


 
for(e=0; e<k ;e++){
  z=a[e], m=b[e];
     for(z; z <= m ; z++){
   count[z]++;
  }
   }

  

   for(i=0; i<n-1 ; i++){
    for(j=i+1; j<n; j++){
   
   if(count[i] > count[j]) {
     t = count[i];
     count [i] = count [j];
     count [j] = t;
   }
    }
   }
 
   answer = n/2+1;

   fprintf(out, "%d", &count[answer]);
   free(count);

time_end = GetTickCount();
time_true = time_end - time_start;
printf("\n Finishing in : %d \n", time_true);
return 0;}

+ -

관련 글 리스트
70152 안녕하세요 c언어 오류 아무리고민해봐도모르겠습니다 ㅠㅠ C언어학도 3226 2013/09/24
70153     Re:안녕하세요 c언어 오류 아무리고민해봐도모르겠습니다 ㅠㅠ 김시환 6647 2013/09/24
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.