RWTPtrSlist core dumps, while removing entries.

N

Neha

#include <rw/tpslist.h>
#include <iostream>
using namespace std;

int main(){
RWTPtrSlist<int> dates;
dates.insert(new int(2)); // 6/2/52
dates.insert(new int(2)); // 6/2/52
// Remove in reverse order:
try
{
while (dates.get()); // When no more entries are there in
list.. it crashes..
}
catch(...)
{
cout << "here" <<endl;
}

return 0;
}
 
V

Vladimir Oka

Neha said:
#include <rw/tpslist.h>
#include <iostream>
using namespace std;

int main(){
RWTPtrSlist<int> dates;
dates.insert(new int(2)); // 6/2/52
dates.insert(new int(2)); // 6/2/52
// Remove in reverse order:
try
{
while (dates.get()); // When no more entries are there in
list.. it crashes..
}
catch(...)
{
cout << "here" <<endl;
}

return 0;
}

comp.lang.c++ is a few steps down the hall. It's marked clearly...
 
M

Martin Ambuhl

Neha wrote, with no stated question:
#include <rw/tpslist.h>

This is not a standard header for either C or C++, and you have not
included any code for it. That makes it off-topic for both comp.lang.c
(where your post appears) and comp.lang.c++ (not referenced in your header).
#include <iostream>

This is not a standard C header. It is a C++ header, suggesting that
you have posted to the wrong newsgroup. comp.lang.c is for discussions
of the C programming language. The different language C++ has its own
newsgroup, comp.lang.c++.
using namespace std;

This is a syntax error without meaning in C.

[more syntax errors follow]
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top