Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > Software > I am getting segmentation fault - WHY?

Reply
Thread Tools

I am getting segmentation fault - WHY?

 
 
bhavinvyas bhavinvyas is offline
Junior Member
Join Date: Dec 2008
Location: mumbai
Posts: 2
 
      12-31-2008
template<class T>
void List<T>:ush(T s)
{
Node<T>* newnode = new Node<T>(s);
if (last == NULL) /* list is empty */
{
first = newnode;
last = newnode;
count++;
}
else
{
newnode->previous = last;
last->next = newnode;
last = newnode;
count++;
}
};

When i compile it compiles properly but when i run/execute a.out it gives me segmentation fault in this what could be the possible cause. Does any one knows the answer. please let me know.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: I'm getting a Segmentation fault after I clear a vector list fudmore C++ 0 05-09-2006 11:00 PM
why am I getting a segmentation fault? Jay donnell Python 6 01-22-2005 04:34 AM
I'm getting a Segmentation fault after I clear a vector list fudmore C++ 9 01-20-2004 02:57 AM
Intel Xeon + Linux + IBM sdk 1.3.1 - getting Segmentation fault Alex Hunsley Java 17 11-06-2003 12:12 AM
Getting Segmentation Fault, selectively, on memory overwrite. Vishal Grover C++ 10 09-11-2003 09:51 AM



Advertisments