![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2009
Posts: 6
Rep Power: 0
![]() |
Problem with pointer in function return
hi all ,
i have problem and three days just trying find out, but no result!! i have two diffirent classes: Xnode and Ynode in Ynode, i have method called tree() which it gets as argument - a reference of Xnode (as const) , and it calls its method to return one private variable xx. void Ynode::tree(const Xnode& x){
const Node* n=x.list();
std::cout << n->value;
}
const Node* Xnode::list() const {
const Node* nod=xx;
std:cout << nod->value;
return nod;
}can you tell me what's wrong? why the pointer is undefined in const Node* n=x.list(); ?? its little urgent!. thanks a lot. Last edited by Ancient Dragon; Nov 23rd, 2009 at 4:31 AM. Reason: replaced icode tags with code tags |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| global vs local pointer with linked lists | aatyler | C | 7 | Sep 10th, 2009 7:02 AM |
| having problem need some help | gentleboy | C++ | 8 | Apr 4th, 2009 9:04 PM |
| simple pointer array w/ function crash | codylee270 | C | 8 | Dec 4th, 2005 8:28 PM |
| Return Strings in Function | hbweb500 | C# | 8 | Jul 10th, 2005 8:44 PM |
| Pointers in C (Part II) | Stack Overflow | C | 2 | Apr 29th, 2005 10:39 AM |