Thread: Uninstantiated object/no default constructor available

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    121

    Uninstantiated object/no default constructor available

    First, thanks to Daved for helping me out with my atoi(char) problem yesterday. Now, the problem I have is this (I still have a lot of perfecting/coding to do, but this is my current sticking point): we have to create a linked list, and use it with a simple line editor, which displays lines of text, and the user must be able to choose between inserting, deleting, and appending to lines of text. I pass the line number from the display() in int main(), and it passes to insertLine() fine, but before I inserted the tmp = new linkedListNode; line, I was getting 'uninstantiated object' errors upon execution (would compile), but now, since I've added tmp = new linkedListNode; I get the error: 'linkedListNode: no default constructor available'. Code below, any help/advice would be greatly appreciated. Sorry if this seems noobish, but I really feel as if the first two C++ classes did not prepare us at all for this. Code below and attached. Thanks in advance!

    -Patrick

    Code:
    #include <iostream>
    #include <string>
    #include <cstring>
    #include <cstdlib>
    using namespace std;
    
    class linkedListNode
    {
          public:
                 char value[255];
                 linkedListNode *nextPtr;
                 linkedListNode(char val[255], linkedListNode *nPtr)
                 {
                                     strcpy(value, val); nextPtr = nPtr;
                 }
    };
    
    class linkedList
     {
          public:
                 linkedList()
                 {
                             headPtr = tailPtr = 0;
                 }
                 ~linkedList();
                 bool isEmpty()
                 {
                      return headPtr == 0;
                 }
    			 void insertLine(int);
                 void addToHead();
                 void addToTail();
    			 void displayList();
                 void deleteFromHead();
                 void deleteNode(int);
    			 void deleteLines(int, int);
    			 void addTextToLine(char*);
                 void deleteFromTail();
         private:
                 linkedListNode *headPtr, *tailPtr;
    }; 
                             
    
    linkedList::~linkedList()
    {
        for(linkedListNode *p; !isEmpty(); )
        {
                           p = headPtr->nextPtr;
                           delete headPtr;
                           headPtr = p;
        }
    }
    
    void linkedList::addToHead()
    {
    	char headTxt[255];
    	cout << "Please enter the text to be inserted into the first line: " << endl;
    	cin.getline(headTxt, 255);
         headPtr = new linkedListNode(headTxt, headPtr);
         if(tailPtr == 0)
            tailPtr = headPtr;
    }
    
    
    void linkedList::addToTail() 
      {  
         linkedListNode *temp, *nextTemp;   
         char input[255]; 
         cout << "Please enter the line of text to be added: ";
         cin.getline(input,255);
    	 cin.ignore();
    	 temp = new linkedListNode();
         temp->nextPtr = NULL;
    
         if (headPtr == NULL) 
            { 
               headPtr = temp;
            }
         else 
           {
               nextTemp = headPtr;
               while (nextTemp->nextPtr != NULL)
               {  
                     nextTemp = nextTemp->nextPtr; 
               }
               nextTemp->nextPtr = temp;
           }
      }
    
    void linkedList::insertLine(int num)
    {
        linkedListNode *tmp, *secondTmp;
    	tmp = new linkedListNode;
    	cout << "OK, enter the text to be added to line " << num << endl;
    	cin.getline(tmp->value, 255);
        int i;
       
    	if(num == 1)
    	 {
    		 headPtr = tailPtr = tmp;
    	 }
    	 else 
    	 {
             for(i = 1; i < num; i++) 
             {
               tmp = tmp->nextPtr;
             }
    	 }
    	 secondTmp->nextPtr = tmp->nextPtr->nextPtr;
         tmp->nextPtr = secondTmp;
         //Now how the heck to insert a node?????
    }
    
    void linkedList::deleteFromHead()
    {
         char *p = headPtr->value;
         linkedListNode *tmp = headPtr;
         if(headPtr == tailPtr) //if only one node in the list;
             headPtr = tailPtr = 0;
         else headPtr = headPtr->nextPtr;
         delete tmp;
    }
    
    void linkedList::deleteFromTail()
    {
         char *p = tailPtr->value;
         if(headPtr == tailPtr) //if only one in list;
         {
                    delete headPtr;
                    headPtr = tailPtr = 0;
         }
         else
         {
             linkedListNode *tmp;
             for(tmp = headPtr; tmp->nextPtr != tailPtr; tmp = tmp->nextPtr);
             delete tailPtr;
             tailPtr = tmp;
             tailPtr->nextPtr = 0;
         }
    }
    
    void linkedList::deleteNode(int num)
    {
         linkedListNode *pred, *tmp;
         int i;
         for(i = 1; i < num; i++)
         {
               pred = pred->nextPtr;
               tmp = tmp->nextPtr;
         }
         if(tmp != 0)
         {
                pred->nextPtr = tmp->nextPtr;
                if(tmp == tailPtr)
                tailPtr = pred;
                delete tmp;
         }
    }
    
    void linkedList::addTextToLine(char *p)
    {
    	 atoi(p);
         int i;
    	 char appTxt[255];
    	 cout << "Enter the text to be appended to line " << p << endl;
    	 cin.getline(appTxt, 255);
    	 cin.ignore();
          linkedListNode *tmp;
         for(i = 1; i <= p[2]; i++)
         {
               tmp = tmp->nextPtr;
         }
         //strcat(tmp.value, *p); //this to access the current node.value???
    }
    
    void linkedList::displayList()
    {
    	linkedListNode *temp;
     int line = 1;
         //Loop to display the content sof the list as long as the list has data
             while (temp != NULL)
             {  
                  // Display details for what temp points to
                  cout << line << "> " << temp->nextPtr << " ";
                  line++;
                  cout << endl; // Line break
    	          temp = temp->nextPtr;
             }
    	     cout << "This marks the end of the list" << endl;
    }
    int main()
    {
    	int lineNum;
    	linkedList l;
    	char response[255];
        do
    	{
    	  l.displayList();
    	  cout << endl;
    	  cout << "Here are your options : " << endl;
    	  cout << "E - Exit program." << endl;
    	  cout << "I - Insert a line." << endl;
    	  cout << "D - Delete a line." << endl;
    	  cout << "A - Append text to that line number." << endl;
    	  cout << endl << " >> ";
    	  cin.getline(response, 255);
    
    	  if(toupper(response[0]) == 'E')
    	  {
    		  exit(1);
    	  }
    	  else if(toupper(response[0]) == 'I')
    	  { 	  
    		  cout << "OK, enter the line number before which you would like " << endl;
    		  cout << " to insert text: " << endl;
    		  cin >> lineNum;
    		  if(lineNum == 1)
    		  {
                  l.addToHead();
    		  }
    		  else if(lineNum == 0)
    		  {
    			  cout << "Line 1 or higher, please!" << endl;
    		  }
    		  else
    		  {
    		  l.insertLine(lineNum);
    		  }
    	  }
    	 
    	  else if(toupper(response[0]) == 'D' && isdigit(response[4]))
    	  {
    		  //l.deleteLines(response[2], response[4]); //Implement this function!!!!!!!!!!!!!!!
    	  }
    	  else if(toupper(response[0]) == 'D' && (response[2]) == '1')
    	  {
    		  l.deleteFromHead();
    	  }
    	  else if(toupper(response[0]) == 'D' && isdigit(response[2]) && !isdigit(response[4]))
    	  {
    		  l.deleteNode(response[2]);
    	  }
    	  else if(toupper(response[0] == 'A'))
    	  {
    		  l.addTextToLine(response);
    	  }
    	  else
    	  {
    		  cout << "Sorry, that was incorrect input.  Please follow the instructions " << endl;
    		  cout << " below carefully!" << endl;
    	  }
    	}
         while (response != 0);
    }

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >'linkedListNode: no default constructor available'
    The error tells you exactly what the problem is. You don't define a default constructor, but you're trying to use one.
    My best code is written with the delete key.

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> First, thanks to Daved for helping me out with my atoi(char) problem yesterday.
    BTW, you didn't actually solve the problem, you just fixed the compile error. Your solution still will not work as you want and might crash the program in some cases.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Quote Originally Posted by www.wikipedia.org
    Default constructor:

    * Can be called with no arguments
    compare this to what you have implemented

  5. #5
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    OK, but the problem is this: When I supply default arguments in the constructor:
    Code:
    class linkedListNode
    {
          public:
                 char value[255];
                 linkedListNode *nextPtr;
                 linkedListNode(char val[255] = 0, linkedListNode *nPtr = 0)
                 {
                                     strcpy(value, val); nextPtr = nPtr;
                 }
    };
    I get the null reference/uninstantiated object. It doesn't like my use of strcpy. I don't see what in the world I am doing wrong; I've checked my C++ reference and text, and even the MS knowlege base, but am not seeing the problem. I know this probably seems like child's play to you guys, but I'm really stuck at this point. Thanks again!

    -Patrick

  6. #6
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    maybe you should have 2 constructors, one as you have it above, however remove the default values (ie =0s), and another, which is exactly the same but takes no parameters, and uses constant '0' and '0' values in place of where the parameters would be.

    is strcpy(0,0) useful anyways?

  7. #7
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >I don't see what in the world I am doing wrong
    Allow me to remove the syntactic sugar and show you what's really going on:
    Code:
    linkedListNode(char *val = 0, linkedListNode *nPtr = 0)
    {
      strcpy(value, val); nextPtr = nPtr;
    }
    Relevant parts are emphasized.
    My best code is written with the delete key.

  8. #8
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    Quote Originally Posted by Prelude
    >I don't see what in the world I am doing wrong
    Allow me to remove the syntactic sugar and show you what's really going on:
    Code:
    linkedListNode(char *val = 0, linkedListNode *nPtr = 0)
    {
      strcpy(value, val); nextPtr = nPtr;
    }
    Relevant parts are emphasized.
    __________________________________________________ __
    OK, so you're saying that I should NOT have the default value of 0 there? I did that thinking that when I initialized a value, it would override the 0 and write whatever I initialized 'val' with into 'value', which is the parameter in the constructor, right? Not so sure anymore, geez...

  9. #9
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    Quote Originally Posted by nadroj
    maybe you should have 2 constructors, one as you have it above, however remove the default values (ie =0s), and another, which is exactly the same but takes no parameters, and uses constant '0' and '0' values in place of where the parameters would be.

    is strcpy(0,0) useful anyways?
    __________________________________________________ _______________
    Nadroj,

    So, maybe I'm reading your response wrong, but this is what I got out of it:
    Code:
                 char value[255];
                 linkedListNode *nextPtr;
                 linkedListNode(char val[255], linkedListNode *nPtr)
                 {
                                     strcpy(value, val); nextPtr = nPtr;
                 }
    and

    Code:
                 linkedListNode(const char val = 0, const linkedListNode *nPtr = 0)
    The second would help me create a new linkedListNode with no parameters, I guess... is this what you meant? Thanks for the help.

    -Patrick

  10. #10
    Registered User
    Join Date
    Apr 2002
    Posts
    52
    Add a second constructor

    not exact to your syntax, but...

    Code:
    linkedListNode()
    {
    
    headPtr = NULL;
    tailPtr = NULL;
    
    }
    MS VC++ 6.0

  11. #11
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    Quote Originally Posted by Fyodorox
    Add a second constructor

    not exact to your syntax, but...

    Code:
    linkedListNode()
    {
    
    headPtr = NULL;
    tailPtr = NULL;
    
    }
    Adding this specific second constructor without modifying anything else creates problems, because I have the two separate classes, linkedList and linkedListNode, and headPtr and tailPtr are defined in linkedList under the private section. Should I try to skirt this protection by maybe using inheritance, or what?

    Also, for my insertLine() function, I modified it a little and was trying to use a tmp value to maybe go sequentially through the list with a for-loop, stopping 1 node before the desired point of insertion, then tie in a new node there, but here is the problem I run in to (looks wacky, I know, but the problem is still the same): How, when I arrive at the desired insertion point and create a new node, do I actually put the text into the 'value' array of the node? I tried the following, and it gives me uninstantiated object again.

    Code:
    void linkedList::insertLine(int num)
    {
        linkedListNode *tmp, *secondTmp; 
    	tmp = headPtr;
    	cout << "OK, enter the text to be added to line " << num << endl;
    	cin.getline(tmp->value, 255);
        int i;
    Thank you/merci beaucoup/vielen Dank/muchas gracias/muito obrigado/bolshoy spaceeba/aligatou...

    -Patrick

  12. #12
    Registered User
    Join Date
    Apr 2002
    Posts
    52
    I used this class and nodeType struct some time back, use this for a comparison for your problem and it should reveal where you're having issues.

    Code:
    #ifndef H_LinkedListType
    #define H_LinkedListType
    
    #include <iostream>
    #include <cassert>
    using namespace std;
    
    template <class Type>
    struct nodeType
    {
    	Type info;
    	nodeType *link;
    };
    
    template<class Type>
    class linkedListType
    {
    	friend ostream& operator<<(ostream&, const linkedListType<Type>&);
    
    public:
        const linkedListType<Type>& operator=
              			      (const linkedListType<Type>&); 
    		//Overloads the assignment operator.
        void initializeList(); 
     		//Initializes the list to an empty state.
    	    //Postcondition: first = NULL, last = NULL,
    		//                count = 0
        bool isEmptyList();
     		//Function to determine whether the list is empty. 
    		//Postcondition: Returns true if the list is empty;
    		//               otherwise, returns false.
    
    	int length();
    		//Function to return the number of nodes in the 
    		//list.
    		//Postcondition: The value of count is returned.
        void destroyList();
     		//Function to delete all the nodes from the list.
      		//Postcondition: first = NULL, last = NULL, 
    		//               count = 0
        Type front(); 
     		//Function to return the first element of the list.
     		//Precondition: The list must exist and must not be
    		//empty.
      		//Postcondition: If the list is empty, then the 
     		//               program terminates; otherwise, 
    	    //               the first element of the list is 
    		//               returned.
        Type back(); 
           //Function to return the last element of the
           //list.
    		//Precondition: The list must exist and must not
    		//be empty.
    		//Postcondition: If the list is empty, then the 
    		//               program terminates; otherwise,
    		//               the last element of the list is 
    		//               returned.
    
       bool search(const Type& searchItem);
    		//Function to determine whether searchItem is in 
    		//the list.
    		//Postcondition: Returns true if searchItem is found
    		//               in the list; otherwise, it returns
    		//               false.
    
        void insertFirst(const Type& newItem);
    		//Function to insert newItem in the list.
    		//Postcondition: first points to the new list 
    		//                and newItem is inserted at the
    		//                beginning of the list.
    
        void insertLast(const Type& newItem);
    		//Function to return newItem at the end of the
    		//list.
    	    //Postcondition: first points to the new list, 
    		//                newItem is inserted at the end
    		//                of the list, and last points to
    		//                the last node in the list.
    
        void deleteNode(const Type& deleteItem);
      		//Function to delete deleteItem from the list.
     		//Postcondition: If found, the node containing 
       		//               deleteItem is deleted from the 
    		//                list, first points to the first
    		//                node, and last points to the last 
    		//                node of the updated list. 
    
        linkedListType(); 
       		//default constructor
     		//Initializes the list to an empty state.
     		//Postcondition: first = NULL, last = NULL, 
    		//               count = 0 
    
        linkedListType(const linkedListType<Type>& otherList); 
             //copy constructor
    
        ~linkedListType();   
        	//destructor
       		//Deletes all the nodes from the list.
        	//Postcondition: The list object is destroyed. 
    
    protected:
        int count;		//variable to store the number of 
     					//elements in the list
        nodeType<Type> *first; //pointer to the first node of 
                               //the list
        nodeType<Type> *last;  //pointer to the last node of 
                               //the list 
    private:
        void copyList(const linkedListType<Type>& otherList); 
    		//Function to make a copy of otherList.
    		//Postcondition: A copy of otherList is created 
    		//               and assigned to this list.
    };
    
    template<class Type>
    bool linkedListType<Type>::isEmptyList()
    {
    	return(first == NULL);
    }
    
    template<class Type>
    linkedListType<Type>::linkedListType() // default constructor
    {
    	first = NULL;
    	last = NULL;
    	count = 0;
    }
    
    template<class Type>
    void linkedListType<Type>::destroyList()
    {
    	nodeType<Type> *temp;   //pointer to deallocate the memory 
    							//occupied by the node
    	while(first != NULL)    //while there are nodes in the list
    	{
    	   temp = first;        //set temp to the current node
    	   first = first->link; //advance first to the next node
    	   delete temp;         //deallocate memory occupied by temp
    	}
    
    	last = NULL;	//initialize last to NULL; first has already
                       //been set to NULL by the while loop
     	count = 0;
    }
    
    	
    template<class Type>
    void linkedListType<Type>::initializeList()
    {
    	destroyList(); //if the list has any nodes, delete them
    }
    
    template<class Type>
    int linkedListType<Type>::length()
    {
     	return count;
    }  // end length
    
    template<class Type>
    Type linkedListType<Type>::front()
    {   
        assert(first != NULL);
       	return first->info; //return the info of the first node	
    }//end front
    
    
    template<class Type>
    Type linkedListType<Type>::back()
    {   
    	 assert(last != NULL);
       	 return last->info; //return the info of the first node	
    }//end back
    
    template<class Type>
    bool linkedListType<Type>::search(const Type& searchItem)
    {
        nodeType<Type> *current; //pointer to traverse the list
        bool found;
    
        current = first; //set current to point to the 
                         //first node in the list
        found = false;   //set found to false
    
        while(current != NULL && !found)		//search the list
            if(current->info == searchItem)     //item is found
               found = true;
            else
               current = current->link; //make current point 
                                        //to the next node
         
         return found;
    }//end search
    
    template<class Type>
    void linkedListType<Type>::insertFirst(const Type& newItem)
    {
    	nodeType<Type> *newNode; //pointer to create the new node
    
    	newNode = new nodeType<Type>; //create the new node
    
    	assert(newNode != NULL);	//If unable to allocate memory, 
     								//terminate the program
    
    	newNode->info = newItem; 	   //store the new item in the node
    	newNode->link = first;        //insert newNode before first
    	first = newNode;              //make first point to the 
                                     //actual first node
    	count++; 			   //increment count
    
    	if(last == NULL)   //if the list was empty, newNode is also 
                          //the last node in the list
    		last = newNode;
    }
    
    template<class Type>
    void linkedListType<Type>::insertLast(const Type& newItem)
    {
    	nodeType<Type> *newNode; //pointer to create the new node
    
    	newNode = new nodeType<Type>; //create the new node
    
    	assert(newNode != NULL);	//If unable to allocate memory, 
     							//terminate the program
    
    	newNode->info = newItem;      //store the new item in the node
    	newNode->link = NULL;         //set the link field of newNode
             						//to NULL
    
    	if(first == NULL)	//if the list is empty, newNode is 
         					//both the first and last node
    	{
    		first = newNode;
    		last = newNode;
    		count++;		//increment count
    	}
    	else			//the list is not empty, insert newNode after last
    	{
    		last->link = newNode; //insert newNode after last
    		last = newNode;   //make last point to the actual last node
    		count++;		//increment count
    	}
    }//end insertLast
    
    template<class Type>
    void linkedListType<Type>::deleteNode(const Type& deleteItem)
    {
    	nodeType<Type> *current; //pointer to traverse the list
    	nodeType<Type> *trailCurrent; //pointer just before current
    	bool found;
    
    	if(first == NULL)    //Case 1; list is empty. 
    		cerr<<"Can not delete from an empty list.\n";
    	else
    	{
    		if(first->info == deleteItem) //Case 2 
    		{
    			current = first;
    			first = first->link;
    			count--;
    			if(first == NULL)    //list had only one node
    				last = NULL;
    			delete current;
    		}
    		else  //search the list for the node with the given info
    		{
    			found = false;
    			trailCurrent = first;   //set trailCurrent to point to
                                     //the first node
    			current = first->link;  //set current to point to the 
        			   //second node
    	
    			while((!found) && (current != NULL))
    			{
      				if(current->info != deleteItem) 
    				{
    					trailCurrent = current;
    					current = current-> link;
    				}
    				else
    					found = true;
    			} // end while
    
    			if(found) //Case 3; if found, delete the node
    			{
    				trailCurrent->link = current->link;
    				count--;
    
    				if(last == current)      //node to be deleted was 
                                         //the last node
    					last = trailCurrent;  //update the value of last
    				delete current;  //delete the node from the list
    			}
    			else
    				cout<<"Item to be deleted is not in the list."<<endl;
    		} //end else
    	} //end else
    } //end deleteNode
    
    
    	//Overloading the stream insertion operator
    template<class Type>
    ostream& operator<<(ostream& osObject, const linkedListType<Type>& list)
    {
    	nodeType<Type> *current; //pointer to traverse the list
    
    	current = list.first;   //set current so that it points to 
    					   //the first node
    	while(current != NULL) //while more data to print
    	{
    	   osObject<<current->info<<" ";
    	   current = current->link;
    	}
    
    	return osObject;
    }
    
    template<class Type>
    linkedListType<Type>::~linkedListType() // destructor
    {
    	destroyList(); 
    }//end destructor
    
    
    template<class Type>
    void linkedListType<Type>::copyList
                	      (const linkedListType<Type>& otherList) 
    {
       nodeType<Type> *newNode; //pointer to create a node
       nodeType<Type> *current; //pointer to traverse the list
    
       if(first != NULL)	//if list is nonempty, make it empty
    	  destroyList();
    
       if(otherList.first == NULL) //otherList is empty
       {
    		first = NULL;
    		last = NULL;
     		count = 0;
       }
       else
       {
    		current = otherList.first;  //current points to the 
    									//list to be copied
    		count = otherList.count;
    
    			//copy the first node
    		first = new nodeType<Type>;  //create the node
    
     		assert(first != NULL);
    
    		first->info = current->info; //copy the info
    		first->link = NULL;  	     //set the link field of 
    									 //the node to NULL
    		last = first;    		     //make last point to the 
                						 //first node
    		current = current->link;     //make current point to the 
               							 //next node
    
    			//copy the remaining list
    		while(current != NULL)
    		{
    			newNode = new nodeType<Type>;  //create a node
    
    			assert(newNode!= NULL);
    
    			newNode->info = current->info;	//copy the info
    			newNode->link = NULL;   	    //set the link of 
                                            //newNode to NULL
    			last->link = newNode; 		//attach newNode after last
    			last = newNode;   			//make last point to
    										//the actual last node
    			current = current->link;	//make current point to
           									//the next node
    		}//end while
    	}//end else
    }//end copyList
    
    
    	//copy constructor
    template<class Type>
    linkedListType<Type>::linkedListType
                	      (const linkedListType<Type>& otherList) 
    {
    	first = NULL;
    
    	copyList(otherList);
    	
    }//end copy constructor
    
    	//overload the assignment operator
    template<class Type>
    const linkedListType<Type>& linkedListType<Type>::operator=
       	 	 		(const linkedListType<Type>& otherList)
    { 
    	if(this != &otherList) //avoid self-copy
    		copyList(otherList);
    
    	return *this; 
    }
    
    #endif
    MS VC++ 6.0

  13. #13
    Registered User
    Join Date
    Oct 2006
    Location
    Canada
    Posts
    1,243
    Code:
    linkedListNode(char val[255] = 0, linkedListNode *nPtr = 0)
                 {
                                     strcpy(value, val); nextPtr = nPtr;
                 }
    i think what Prelude was saying is that when you assign your val (char array/char pointer) your assigning it to 0, you should use quotes,
    ie: char val[255] = "string";, or single quotes when assigning one element, such as: val[0] = 'a';

    a default constructor is one that doesnt take any parameters, so try and add this to your public section of this file:
    Code:
    linkedListNode()
                 {
                       // i think you should get rid of BOTH default parameters in your previous
                       // constructor though, as well as adding this 2nd (Default) constructor
                       nextPtr = NULL;
                 }
    Last edited by nadroj; 10-24-2006 at 07:54 PM.

  14. #14
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    Thanks, Nadroj, that makes a lot more sense! OK, but even thought the constructor method signatures differ, I get the 'ambiguous call to overloaded function' error upon compiling. Any suggestions on that?

    -Patrick

  15. #15
    Registered User
    Join Date
    Jun 2006
    Posts
    121
    Hmmmm, when I put 'linkedListNode *nextPtr in the constructor method parameter list, it compiles, no problem.

    -Patrick

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Utilizing another compiled program for a task.
    By kotoroshinoto in forum C Programming
    Replies: 6
    Last Post: 06-03-2008, 01:43 PM
  2. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM
  3. A question about constructors...
    By Wolve in forum C++ Programming
    Replies: 9
    Last Post: 05-04-2005, 04:24 PM
  4. Help with default parameter value using ptr-to-functor
    By registering in forum C++ Programming
    Replies: 2
    Last Post: 03-24-2004, 04:21 PM
  5. Switching Default Buttons :: MFC
    By kuphryn in forum Windows Programming
    Replies: 2
    Last Post: 07-02-2002, 04:08 PM