2010-03-28 5 views
-2

나는 custom struct를 인수로 취하는 함수를 가지고있다. 논증이 무엇인지 알아 내려면 어떻게해야합니까? 나는 (... 목표 - C로 수입 C 라이브러리) 그것은 종류의 날짜 형식입니다 ...사용자 정의 구조체의 함수 인수를 찾아 낼 수 있습니까?

구조체 알고

typedef struct 
{ 
    /** The number of day in the hebrew month (1..31). */ 
    int hd_day; 
    /** The number of the hebrew month 1..14 (1 - tishre, 13 - adar 1, 14 - adar 2). */ 
    int hd_mon; 
    /** The number of the hebrew year. */ 
    int hd_year; 
    /** The number of the day in the month. (1..31) */ 
    int gd_day; 
    /** The number of the month 1..12 (1 - jan). */ 
    int gd_mon; 
    /** The number of the year. */ 
    int gd_year; 
    /** The day of the week 1..7 (1 - sunday). */ 
    int hd_dw; 
    /** The length of the year in days. */ 
    int hd_size_of_year; 
    /** The week day of Hebrew new year. */ 
    int hd_new_year_dw; 
    /** The number type of year. */ 
    int hd_year_type; 
    /** The Julian day number */ 
    int hd_jd; 
    /** The number of days passed since 1 tishrey */ 
    int hd_days; 
    /** The number of weeks passed since 1 tishrey */ 
    int hd_weeks; 
} hdate_struct; 

기능 :

int 
hdate_get_omer_day(hdate_struct const * h) 
{ 
    int omer_day; 
    hdate_struct sixteen_nissan; 

    hdate_set_hdate(&sixteen_nissan, 16, 7, h->hd_year); 
    omer_day = h->hd_jd - sixteen_nissan.hd_jd + 1; 

    if ((omer_day > 49) || (omer_day < 0)) 
     omer_day = 0; 

    return omer_day; 
} 

이 함수를 호출하려고 시도했지만 날짜가 어떻게되는지 확신 할 수 없습니다. 줄리안 (Julian)을 히브리어 (Hebrew)로 변환하는 함수도 있습니다. 모두 동일한 구조체를 가져 오거나 반환합니다.

함수의 반환 값을 얻으려면 어떻게해야합니까?

+0

예를 들면? _ – kennytm

+0

"날짜에 무엇이 들어가는 지 확실하지 않습니다."라는 뜻입니까? *h 또는 sixteen_nissan

+0

@David - 기능이 저에게 원하는 것은 무엇입니까? 나는'* h '를 의미한다. – Moshe

답변

1

은 히브리어 날짜를 입력하려는 것처럼으로 보입니다. 그래서, 우리는 그것을 만드는 방법을 이해해야합니다. "hdate_struct"또는 "hdate_struct로 변환"등으로 인터넷 검색을 시도하십시오.

Otoh, 함수를 습득하는 코드 Omer의 함수, hdate_get_omer_day() 함수 중에 유대인의 의식을 계산 Omer가 아닌 경우 Zeor를 반환하고 Omer의 49 일 중 하나 인 경우 1을 반환하는 것처럼 보입니다 (wikipedia "40 "유월절과 주간의 절기 사이의 9 일").

당신은 오메르 일을 계산하는 코드에 대한 인터넷 검색을 시도 할 수 :

(예를 들어, http://www.google.com.sg/url?sa=t&source=web&ct=res&cd=5&ved=0CBcQFjAE&url=http%3A%2F%2Fwww.myjewishlearning.com%2Fblog%2Fholidays%2Fhow-to-make-your-own-omer-counter%2F&rct=j&q=get+omer+Day&ei=awOvS5TvHIjGrAe_3vGmAQ&usg=AFQjCNGJh7Ydy-VkfwlyzTL_ELIkiqP25w "하는 방법 자신의 오메르 Counte 확인")는 "나머지는 독자들에게 연습 문제로 남겨".

+0

고마워, 알았어. hdate_struct가 라이브러리에 내장되어 있지만 구조체의 초기화 프로그램을 찾을 수 없습니다. 알았어. 감사! 그리고 오메르 카운터 기능이 작동하는 것 같습니다. – Moshe

관련 문제