WizardStan
Mega GP Mania
- Joined
- May 24, 2008
- Messages
- 16,731
This will actually stop eventually, when your computer runs out of memory. new returns null if you're out of allocatable memory, at which point your program will presumably carry on, probably sending the huge amount of memory it's collected to swap to be completely forgotten about, complete its task, exit, and then return the entirety back to the OS.Code:while(new int);
I love C++!
edit: as opposed to the while(true) method which goes
Program: Give me memory
OS: no, there is no more, you've eaten it all
P: Give me memory!
OS: NO!
P: Give me memory!
OS: fine, I'll kill off some random processes
P: OMNOMNOM! More please
OS: FFFFFUUUUUUUUUUUU
Last edited by a moderator: