User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the C++ section within the Software Development category of DaniWeb, a massive community of 391,860 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,571 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our C++ advertiser:

Using a class to add/delete/show numbers in a Link List

Join Date: Sep 2004
Posts: 6,017
Reputation: Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of Narue has much to be proud of 
Rep Power: 26
Solved Threads: 414
Super Moderator
Narue's Avatar
Narue Narue is offline Offline
Expert Meanie

Re: Using a class to add/delete/show numbers in a Link List

  #2  
Apr 2nd, 2005
>Node *newPtr = new Node ;
You're trying to use a constructor with no arguments, yet your Node is declared as:
struct Node
{
   Item item;
   Node *next;

   Node( Item itm, Node * nxt ) 
	: item(itm), next(nxt) { }
};
Notice how the only constructor declared takes two arguments. If you declare any constructors then the default constructor is not created automagically for you.

>Any suggestions ?
Be prepared for a good time trying to get this program to work. :mrgreen:
Member of: Beautiful Code Club.
Reply With Quote  
All times are GMT -4. The time now is 6:41 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC