Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 689609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T02:21:00+00:00 2026-05-14T02:21:00+00:00

I have a function which takes a custom struct as the argument. how can

  • 0

I have a function which takes a custom struct as the argument. how can I figure out what the argument should be? I know it is a date format of sorts… (C library imported to Objective-C…)

Struct:

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;

Function:

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;
}

Trying to call this function, not sure what goes into the date. There are functions for converting Julian to Hebrew too, all taking or returning the the same struct.

What do i do to get the function’s return value?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T02:21:00+00:00Added an answer on May 14, 2026 at 2:21 am

    It looks like you want to input a Hebrew date. So, you have to figure our how to create one. Try googling for “hdate_struct” or “convert to hdate_struct” or the like.

    Otoh, code rading the function Counting of the Omer, Jewish ritual during the function hdate_get_omer_day() it looks like it returns zeor if not during Omer and 1 to 49 if one of the 49 days of Omer (See wikipedia “forty-nine days between Passover and the Feast of Weeks”).

    You could try googling for code to calculate the Omer day (e.g “How To: Make Your Own Omer Counte” 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)

    “The remainder is left as an exercise for the reader”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple function which takes an array of characters as an argument,
I have a function which takes two arguments, the ID of an item (wine)
I have a function which takes several boolean template arguments: template<bool par1, bool par2,
I have a function which takes a block of data and the size of
I have a function which takes in two parameters, and returns one or the
The title more or less says it all: I have a function which takes
I have a variadic function which takes a float parameter. Why doesn't it work?
I have a merge function which takes time O(log n) to combine two trees
I have a ColdFusion function foo which takes three args, and the second two
I have a DLL which takes care of custom drawing for some special glass

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.