New to classes

I am programming a schedule and task manager, something like an agenda for me to use.
I have this class here:


class Horario {
horpiece p [];
public:
void asignar (horpiece []);
horpiece obtener (void);
} hor;


Horario means schedule in spanish. I want to have an array of "horpiece" objects (literaly means schedule pieces, like in a puzzle, every "horpiece" has its own day, duration, and task). The problem is the compiler makes me give the array a length, but the schedule may not always have the same length.
It could have some empty hours in which I will draw a "Empty" text using an algorythm

So I don't want to give my array a length. I want it to be just horpiece p [];


I gave it 24*7 of length:

class Horario {
horpiece p [(24*7)];
public:
void asignar (horpiece []);
horpiece obtener (void);
} hor;

but tasks don't always have a duration of one hour and also don't always start at exactly 07:00 AM


I tried creating a new variable int l and setting it as the array length but it won't work either.

class Horario {
int l; horpiece p [l];
public:
void asignar (horpiece []);
horpiece obtener (void);
} hor;



Long story short: have and array inside my class and don't wanna give it an exact definite length.
Any help?
thank you :)
Registered users can post here. Sign in or register to post.