W
wang
Hi all,
I have the class declaration as follows:
class MyClass {
public:
map<string, string> account;
}
The main program uses the class as follows:
MyClass customer;
string acc = "abc", ort = "xyz";
customer.account[acc] = ort;
In VC++6, the compilation succeeded, but debug causes the error when
running the last instruction ("customer.account[acc] = ort;"):
Unhandled exception in customer.exe (MSVCRTD.DLL): 0xC0000005: Access
Violation.
What should be done to avoid this? Many thanks in advance!
kwwang
I have the class declaration as follows:
class MyClass {
public:
map<string, string> account;
}
The main program uses the class as follows:
MyClass customer;
string acc = "abc", ort = "xyz";
customer.account[acc] = ort;
In VC++6, the compilation succeeded, but debug causes the error when
running the last instruction ("customer.account[acc] = ort;"):
Unhandled exception in customer.exe (MSVCRTD.DLL): 0xC0000005: Access
Violation.
What should be done to avoid this? Many thanks in advance!
kwwang