while(memory_address)
-
Hi i have the following piece of code temp= some_memoryAddress while(temp) { doSmth(); temp = anotherMemoryAddress } what does the expression while(temp) do, i never seen memory address as an condition in the while loop. Thanks
This is equal to:
temp= some_memoryAddress
while(temp != 0)
{
doSmth();
temp = anotherMemoryAddress
}Clippy: It seems you're mantaining someone else's code, who knew C++ better than you. Good luck! lazy isn't my middle name.. its my first.. people just keep calling me Mel cause that's what they put on my drivers license. - Mel Feik
-
Hi i have the following piece of code temp= some_memoryAddress while(temp) { doSmth(); temp = anotherMemoryAddress } what does the expression while(temp) do, i never seen memory address as an condition in the while loop. Thanks
doSmth should do something and change anotherMemoryAddress, otherwise this code doesn't make any sense. some_memoryAddress should be initially non-NULL. The while loops until anotherMemoryAddress is NULL. This is normally the case when doSmth fails or doSmth has enumerated all memory addresses of anything. :-D -Dominik
-
doSmth should do something and change anotherMemoryAddress, otherwise this code doesn't make any sense. some_memoryAddress should be initially non-NULL. The while loops until anotherMemoryAddress is NULL. This is normally the case when doSmth fails or doSmth has enumerated all memory addresses of anything. :-D -Dominik
-
great! this is the answer i need!!! ;) The while loops until anotherMemoryAddress is NULL so this equals to while(memory_address != NULL) { DoSomth(); } Regard,
Exactly :-D -Dominik