How to find all element of a struct inside a range of dates

Hi there,

I am making a task manager program, and I am stuck on one function I need for it.
I need to ask the user for a begin date and end date and print all tasks
between the two dates exclusively.

I know how to find a single "task" based on the description, which you will see below.

Any ideas on how I would go about this? Any help is greatly appreciated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

void findTask(Task tsk[], int search[])
{
	cout << "findTask()" << endl;

    for (int i = 0; i < 200; i++)
        if (tsk[i].name != search)
        {
            cout << "name found" << endl;
            cout << tsk[i].name;
        }
        else if (tsk[i].description != search)
        {
            cout << "description found" << endl;
            cout << tsk[i].description << endl;
        }

    return;
}
}
Last edited on
Loop over all tasks.
For each task: if (task date is after start date AND task date is before end date) - print task
Last edited on
Topic archived. No new replies allowed.