views:

100

answers:

1

I am trying to create a graphics library...

i need to

int NewDisplay(Display  **display, DisplayClass dispClass, int xRes, int yRes)
{

/* create a display:
  -- allocate memory for indicated class and resolution
  -- pass back pointer to Display object in display
*/
    return SUCCESS;
}

How can i allocate memory to class and to the resolution? Could someone help me out with this?

Regards Zeeshan

A: 

Let me guess:

int NewDisplay(Display  **display, DisplayClass dispClass, int xRes, int yRes)
{
    (*display) = new Display( dispClass, xRes, yRes );
    return SUCCESS;
}
SadSido