What is the difference between
TokenItem *tok = new TokenItem(); delete tok;
and
TokenItem tok = TokenItem();
In the later example, I suppose there is some sort of mechanism to track the...
Type: Posts; User: derder
What is the difference between
TokenItem *tok = new TokenItem(); delete tok;
and
TokenItem tok = TokenItem();
In the later example, I suppose there is some sort of mechanism to track the...
Also is it true that as long as I don't create classes using new and a pointer then I don't have to worry about memory leaks and deallocation? Is this called static allocation?
What's the best way...
Hello,
I have a while loop, and in it, I allocates a new class called TokenItem. It is then pushed into a vector. Question: When is the TokenItem deallocated? Do I have to explicitly delete it?
...