Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualAnubiss

Posted 24 January 2012 - 04:01 PM

But i only have to use free() if i really want to destroy an "object"? So i can create, create and create and only for "n"- 1 (for example) i need to free the memory then?

EDIT:

btw, there´s a new question i have.
i made an option-menu

//Handelsbildschirm:
/////////////////////////////////////////////////
void handelsbildschirm(void){
while(1){
  PA_OutputText(1,0,1,"++++++++++++++++");
  PA_OutputText(1,0,2," Station: %02d", stations[istationen].id);
  PA_OutputText(1,0,3,"++++++++++++++++");
  PA_OutputText(1,2,5,"Handelsbildschirm");
  PA_OutputText(1,0,6,"++++++++++++++++");
 
  PA_OutputText(1,0,optionskursor,"o");
   if(Pad.Newpress.Down)optionskursor++;
if(Pad.Newpress.Up)optionskursor--;
  if(Pad.Newpress.B)break;
}
}

//Stations-Menü:
/////////////////////////////////////////////////
void stationsmenu(void){

PA_OutputText(1,0,1,"++++++++++++++++");
PA_OutputText(1,0,2," Station: %02d", stations[istationen].id);
PA_OutputText(1,0,3,"++++++++++++++++");
PA_OutputText(1,2,5,"Handelsbildschirm");
PA_OutputText(1,2,6,"Stationsinformationen");
PA_OutputText(1,2,7,"Schiffsinformationen");
PA_OutputText(1,0,optionskursor,"o");
if(Pad.Newpress.Down)optionskursor++;
if(Pad.Newpress.Up)optionskursor--;
if(Pad.Newpress.A){
  PA_ClearTextBg(1);
  switch(optionskursor){
 
  case 5:
  handelsbildschirm();
 
  }
}
}

I choose with my cursor the option "Handelsbildschirm" an it leads me to the new menu, but there the cursor does not move. is it because of the "while()" ?

#1Anubiss

Posted 24 January 2012 - 03:57 PM

But i only have to use free() if i really want to destroy an "object"? So i can create, create and create and only for "n"- 1 (for example) i need to free the memory then?

PARTNERS