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 8056339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:40:25+00:00 2026-06-05T08:40:25+00:00

I need to have an idea to write a part of a program I

  • 0

I need to have an idea to write a part of a program I am supposed to do.

This part is meant to be an agenda were we can schedule something and check what conflicts we have when making a new appointment.

I have though of using some kind of structures, but I guess I am complicating the whole thing.

I was thinking of having a struct for the year, a struct for the month and a new struct for the day. Then, the year was having the month structure and the month was having the day structure. But I feel that this can be made more simpler, I just can’t get any better ideas.

How can I make this more simpler?
I just need to make something to store a new appointment on a day and hours and something that it cannot have two appointments for the same time.

Any help, I would appreciate.

enum DiaSemana { Domingo, Segunda, Terca, Quarta, Quinta, Sexta, Sabado };

struct Dia {
    int dia;
    int semana;
    char* horas[24][60];
};

struct Meses {
    int mes;
    char* nome[11];
    struct Dia dia;
};

struct Ano {
    int ano;
    tipoAno tipo;
    struct Meses jan;
    struct Meses fev;
    struct Meses mar;
    struct Meses abr;
    struct Meses mai;
    struct Meses jun;
    struct Meses jul;
    struct Meses ago;
    struct Meses set;
    struct Meses out;
    struct Meses nov;
    struct Meses dez;
};
typedef struct Ano ANO;
typedef ANO *PANO;

int validaBi(int ano) {
    if(ano%4==0)
        return 0;
    else
        return 1;
}
  • 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-06-05T08:40:26+00:00Added an answer on June 5, 2026 at 8:40 am

    When dealing with problem like this, you essentially got to figure what information you want to put into application and what do you want from it.

    1. I understand you start with an empty calendar – no events yet.
    2. Then you will want to put an event, say, on 2012-06-11/10:00 till 2012-06-11/12:00.

    So what we can see now, we have an event with begginning and ending. Forgive me using a bit of OOP here, but it still applies to C.

    typedef struct 
    {
        DateTime Start, End;
    } Event;
    

    Great. However, what is a DateTime? We’re going to need that one too.

    typedef struct
    {
        int Year, Month, Day;
        int Hour, Minute;
    } DateTime;
    

    Now I’m gonna really miss the “++” part in C++, but still…

    typedef struct
    {
        int EventCount;
        Event Events[MAX_EVENTS];
    } Calendar;
    

    Again, forgive me my ignorance in C. So what we’ve created here is the basic concept of our system. As you probably see now, next step would be the Add(Calendar, Event) function, but it’s now up to you to figure this out.

    I’m not saying the above solution is the best, the only one, nor complete. I just wanted to give you a hint on a solving problems like this.

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

Sidebar

Related Questions

I have a python program that does something like this: Read a row from
I need to write an excel-like grid that can have a lot of cells
I need to archive data from a CRM system. Does anyone have any idea
Here is the idea I would like to develop. I need to have an
I have been reading that using HibernateDaoSupport isn't a good idea, so I need
I have need to pack four signed bytes into 32-bit integral type. this is
I need to have a dynamic URL preferably from a Test Class. Can any
I try to write a daemon in python. But I have no idea how
I have a need to write an client-server application where a tiny server rests
Let's say you have to [write from scratch, rewrite, refactor] a sample program illustrating

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.