J
jschvat
I get the following output in vs2005:
'AllocationTest.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols
loaded. Detected memory leaks!
Dumping objects ->
{263} normal block at 0x00356CD8, 564 bytes long.
Data: <H 5 5 5 5 > 48 A0 35 00 C8 A0 35 00 88 A0 35 00 08 A1 35 00
Object dump complete.
The program '[2212] AllocationTest.exe: Native' has exited with code 0 (0x0).
with this code... what am I missing?
#include "crtdbg.h"
#include <iostream>
#include <vector>
using namespace std;
class Allocator {
private:
int k;
public:
Allocator(int value) { k=value;}
~Allocator() { cout<<"deleting : "<<k<<endl; }
int value() { return k; }
void assign(int x) {k=x;}
};
int _tmain(int argc, _TCHAR* argv[])
{
int index;
int const count=100;
vector<Allocator *> v;
Allocator *t;
for(index=0;index<count;index++) {
t=new Allocator(index);
v.push_back(t);
}
for(index=0;index<count;index++) {
delete v[index];
}
_CrtDumpMemoryLeaks();
return 0;
}
thanks
'AllocationTest.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols
loaded. Detected memory leaks!
Dumping objects ->
{263} normal block at 0x00356CD8, 564 bytes long.
Data: <H 5 5 5 5 > 48 A0 35 00 C8 A0 35 00 88 A0 35 00 08 A1 35 00
Object dump complete.
The program '[2212] AllocationTest.exe: Native' has exited with code 0 (0x0).
with this code... what am I missing?
#include "crtdbg.h"
#include <iostream>
#include <vector>
using namespace std;
class Allocator {
private:
int k;
public:
Allocator(int value) { k=value;}
~Allocator() { cout<<"deleting : "<<k<<endl; }
int value() { return k; }
void assign(int x) {k=x;}
};
int _tmain(int argc, _TCHAR* argv[])
{
int index;
int const count=100;
vector<Allocator *> v;
Allocator *t;
for(index=0;index<count;index++) {
t=new Allocator(index);
v.push_back(t);
}
for(index=0;index<count;index++) {
delete v[index];
}
_CrtDumpMemoryLeaks();
return 0;
}
thanks