A weird segmentation fault!# Programming - 葵花宝典
m*e
1 楼
I implemented a simple list class. There is a member function "=", which
define the assignment two list.
When I am testing the list class with following code, I got very weird
segmentation fault.
******************************************************
int main()
{
IntList a;
int i;
for(i=0; i<3; i++)
{
a.add_entry(1);
}
IntList b;
for(i=0; i<1; i++)
{
b.add_entry(100);
}
char s;
define the assignment two list.
When I am testing the list class with following code, I got very weird
segmentation fault.
******************************************************
int main()
{
IntList a;
int i;
for(i=0; i<3; i++)
{
a.add_entry(1);
}
IntList b;
for(i=0; i<1; i++)
{
b.add_entry(100);
}
char s;