why debug error here?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <vector>
using namespace std;


template<class T>
void de_serialize(T& t) {
}

template<class Content>
void de_serialize(vector<Content>& ct) {
	Content c; // the Content should be  packet*  here
	de_serialize(c);
}

struct packet {};

vector<packet*> v;

void de_serialize(packet* p) { // so this function should be called
	p = new packet;
	cout << "yes" << endl;
}

int main() {
	de_serialize(v);
}

here's the code, I expect it prints "yes", but it popups a debug error messagebox, why is that?

Thanks.
I found the solution here
http://msdn.microsoft.com/en-us/library/6kasb93x(v=vs.71).aspx
add this line:
#pragma runtime_checks( "u", off )
I have a problem with debugging and with "pdb" files:
This is my program:

#include <iostream >
using namespace std;
void main ()
{
int l, h, a;
cout << "L= ";
cin >> l;
cout << "H= ";
cin >> h ;
a = l * h ;
cout << "Aria este " << a << endl;
system("PAUSE");
}



'arie.exe': Loaded 'D:\c++pROIECTE\arie\Debug\arie.exe', Symbols loaded.
'arie.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\msvcp100d.dll', Symbols loaded.
'arie.exe': Loaded 'C:\WINDOWS\system32\msvcr100d.dll', Symbols loaded.
'arie.exe': Loaded 'C:\WINDOWS\system32\apphelp.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\version.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Symbols loaded (source information stripped).
'arie.exe': Loaded 'C:\WINDOWS\system32\secur32.dll', Symbols loaded (source information stripped).
The program '[3608] arie.exe: Native' has exited with code 0 (0x0).
Topic archived. No new replies allowed.