map throwing unhandled exception

L

lnwb

Hi does anyone know the answer to this one.
If I use the following code on the same page as the main{ } function
then it works ok.
If I use it on an external page like a header page for a class it
throws an unhandled exception when the program is closed,driving me
nutsssss

typedef map<string,map<string,int> > CatNSubs;//to hold the category
list and
CatNSubs subTable;//for catagory and subs
typedef CatNSubs::const_iterator mapIter;
typedef map<string,int>::const_iterator innerMapIter;

as I said this works perfectly on the main page.

regards LB
 
R

Rolf Magnus

Hi does anyone know the answer to this one.
If I use the following code on the same page as the main{ } function
then it works ok.
If I use it on an external page like a header page for a class it
throws an unhandled exception when the program is closed,driving me
nutsssss

typedef map<string,map<string,int> > CatNSubs;//to hold the category
list and
CatNSubs subTable;//for catagory and subs
typedef CatNSubs::const_iterator mapIter;
typedef map<string,int>::const_iterator innerMapIter;

as I said this works perfectly on the main page.

Please post a minimal, but _complete_ program that shows the problem. Those
four lines of code don't contain the error that leads to the behavior you
observed.
 
K

kasthurirangan.balaji

Hi does anyone know the answer to this one.
If I use the following code on the same page as the main{ } function
then it works ok.
If I use it on an external page like a header page for a class it
throws an unhandled exception when the program is closed,driving me
nutsssss

typedef map<string,map<string,int> > CatNSubs;//to hold the category
list and
CatNSubs subTable;//for catagory and subs
typedef CatNSubs::const_iterator mapIter;
typedef map<string,int>::const_iterator innerMapIter;

as I said this works perfectly on the main page.

regards LB

may i refer you http://www.parashift.com/c++-faq-lite/how-to-post.html

Thanks,
Balaji.
 
P

Paavo Helde

(e-mail address removed) wrote in (e-mail address removed):
Hi does anyone know the answer to this one.
If I use the following code on the same page as the main{ } function
then it works ok.
If I use it on an external page like a header page for a class it
throws an unhandled exception when the program is closed,driving me
nutsssss

So why don't you set your debugger break on exceptions and find out who is
generating the exception and what it is?

Paavo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,113
Latest member
Vinay KumarNevatia
Top