From the discussion started here, I\'d like to know whether the following code has a memory leak:
int main()
{
new int();
//or
int* x = new int();
Yes, there is a leak of 4 bytes because memory allocated by new is not deleted and during the life of the application it is a leak.
From this link:
http://www.yolinux.com/TUTORIALS/C++MemoryCorruptionAndMemoryLeaks.html
Memory leak description: Memory is allocated but not released causing an application to consume memory reducing the available memory for other applications and eventually causing the system to page virtual memory to the hard drive slowing the application or crashing the application when than the computer memory resource limits are reached. The system may stop working as these limits are approached.