HILFE - Dringend!!!!!!!!!!!!!
-
Brauche bitte schnell eine Antwort auf die folgende Frage:
Frage 2: Im folgenden Code ist eine bösartige Zeitbombe versteckt, welche?
int *aFunction()
{
int an_array[5];
unsigned count = 5;
while(count--)
an_array[count] = count;
return an_array;
}danke
-
ok hat sich erledigt...
-
Pointer auf lokales Objekt zurückgegeben.
Trotzdem sollte der Code wohl so besser aussehen:int *aFunction() { int an_array[5]; for(unsigned count = 4; count >= 0; --count) { an_array[count] = count; } return an_array; }
-
ok thx
PS: ist eine testangabe. egal wie die aussieht...
thx nochmal