Same pointers but not same values

i have this in list class;
1
2
3
4
5
6
7
8
9
10
11
12
13
   
public:
obj_node * cur_x;
void insert(obj_node * a, Object b)
    {
        obj_node * p = new obj_node;
        p->value = b;
        p->next = a->next;
        a->next = p ;
        size++;
        cur_x = a->next;
        std::cout << cur_x->value << "ok" << std::endl ;
    }

I gives me true value in insert. But i can not get same true value in main via listname.cur_x->value. It gives me some irrelevant big numbers.



Topic archived. No new replies allowed.