Re: [Dev-C++] Simple SIMPLE C++ q...
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Elizabeth B. <sog...@ya...> - 2002-10-25 15:47:45
|
"Daniel Glenfield" <sp...@ho...> writes: > If I create a variable, say > > int NumberOfDays = 0; > > and I decide that I want to delete the variable from memory, how do I do > this? I don't think I can use delete[] can I, as it's not a pointer. Must I > create a pointer then call delete? But then how do I remove the pointer? > > I'm sure I know the answer to this, but I can't remember!!! Its on the stack and not the heap and will be automatically deleted when NumberOfDays goes out of scope. If you want control over when the memory is created and deleted, use a pointer. Elizabeth |