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

C/C++ Q/A
[6229] 질문을 다시 올립니다.
김주상 [] 5757 읽음    2008-09-18 19:53
프로그램을 직접 돌려서 출력값을 눈으로 보는 것이 소스를 이해 하는게 더 빠를 것 같아 질문을 다시 올립니다.

WaitHtime 함수의 출력 값을 보기 위한 메인 함수를 구현 하고 싶은데요... 제가 워낙 c언어 초짜라 어떻게 해야 될지 모르겠습니다.
pos는 83,hsec는 100 이며 Emergency는 0 또는 1 아무거나여도 상관 없습니다.
이 프로그램을 만든 사람이랑 연락 두절 상태라 물어볼데가 없습니다. 부디 좋은 답변 부탁드립니다.

#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <dos.h>

unsigned long _Time2HSec(int hour, int min, int sec, int msec)
{
    long  secs;
    secs = hour*360000L + min*6000L + sec*100L + msec;
    return secs;
}

unsigned long Time2HSec(struct time ct)
{
    return
_Time2HSec(ct.ti_hour % 24,
     ct.ti_min  % 60,
     ct.ti_sec  % 60,
     ct.ti_hund %100);
}

int WaitHTime(int pos, long hsec)
{
int EmerGency;
    static unsigned long TS[100],TE[100];
    struct time t1,t2;
    static int TA[100],init=0;

    if(EmerGenCy){ TA[pos]=0; return 0;}
    if(pos<0 || pos>99) return 0;
    if(!init) for(init=0; init<100; init++) TA[init]=0;
    if(!hsec) {TA[pos]=0; return 0;}
    disable();
    if(!TA[pos]) {gettime(&t1); TS[pos]=Time2HSec(t1)+hsec; TA[pos]=-1;}
    gettime(&t2); TE[pos]=Time2HSec(t2);
    if((long)(TS[pos]-TE[pos])>4320000L)    TE[pos]+=24L*60L*60L*100L;
    if(TS[pos]<=TE[pos]) TA[pos]=0;
    enable();
    return TA[pos];
}

+ -

관련 글 리스트
6229 질문을 다시 올립니다. 김주상 5757 2008/09/18
6231     Re:질문을 다시 올립니다. 남병철.레조 9147 2008/09/19
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.