Afficher un message
Vieux 15/10/2007, 19h33   #2
Victor Bazarov
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: The elevator simulation

whitehatmiracle@gmail.com wrote:
> Hi all...
> Im getting some errors, and have no clue, as to what could be wrong...
>
> SOS... anybody ??
> heres the code:
>
> [..]
> //error, type qualifier 'elevator' must be a struct or clas name
> // error declaration terminated incorrectly
> elevator::button *b(int n) : button_array(0), number(n)
> {
> button_array= new button*[number + 1];
> for(int i = 0; i < number + 1; ++i)
> button_array[i] = new button;
> }
>
> elevator::~elevator()
> {
> for(int i = number; i >= 0; --i)
> delete button_array[i];
> delete [] button_array;
> }


What are those two "functions" supposed to be for? If they are
definitions of the member functions of the 'elevator' class, they are
processed by the compiler before the class. If they are not members,
what are they? Also, you seem to have two different versions of the
'elevator' destructor in your code. You need to pick one (and remove
the other).

>
>
> class elevator
> {
> [..]


V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask


  Réponse avec citation
 
Page generated in 0,05847 seconds with 9 queries