U R trying to allocate memory for your # of rooms.
allocating desired number of rooms in a hotel manaement system
An example might be:
For discrete objects of type Blanks, the global operator new function is hidden. Therefore, the following code allocates an object of type Blanks and initializes it to 0xa5:
void *operator new( size_t stAllocateBlock, char chInit );
void *Blanks::operator new( size_t stAllocateBlock, char chInit )
void *pvTemp = malloc( stAllocateBlock );
if( pvTemp != 0 )
memset( pvTemp, chInit, stAllocateBlock );
The argument supplied in parentheses to new is passed to Blanks::operator new as the chInit argument. However, the global operator new function is hidden, causing code such as the following to generate an error:
Blanks *a5 = new( 0xa5 ) Blanks;
return a5 != 0;
Blanks *SomeBlanks = new Blanks;
Pls let me know if this helps!
Disable Smilies in This Post by Salem