since this is a c++ program, use std::string instead of char arrays. std::string is a lot easier to use.
struct Node
{
std::string Descrip;
double Price;
int Quant;
Node *Link;
};
...
void InsertFunction(char *InitDescrip, double InitPrice, int InitQuant, Node *Current)
{
Current->Descrip = InitDescrip;
Current->Price = InitPrice;
Current->Quant = InitQuant;
Current->Link = Root;
}
of course if you must use those C char arrays, then do this
strcpy(Current->Descrip,InitDescrip);
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
Notice that you have a bug where you write,
if(nextchar = '\n')cin.ignore();
I think you meant nextchar == '\n'.
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177