hey everyone, newbie programmer here, and i am working on a project to use linked lists, by creating a linked list class. basically i am using old code and modifying it to work with a linked list class. i am using visual studio to debugg, and it seems that my code is having trouble viewing the LLEle_t type i have created. I am trying to see how i can fix this problem so any help is appericated.

here is the code

/*	Devang N. Joshi
	CSCI 208
	Assignment 10
	Linked List Class
*/

#include <iostream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <fstream>
using namespace std;

//*************************************************************************************************  
      				                   /* Global Variables */    
//*************************************************************************************************
 
    const int NAMESIZE=25;
    const int FILENAME=51;
    const int MAXLISTSIZE=200;       
  
    typedef char Name_t[NAMESIZE];
    typedef char Filename_t[FILENAME];
    typedef int ID_t;
    typedef double Bal_t;
    typedef fstream Infile_t;
    typedef fstream Outfile_t;
       
//*************************************************************************************************
      				               /* Class Declerations */   
//*************************************************************************************************

    class cAccount
    {
		private:
			
			Name_t fname;
      		Name_t lname;
      		ID_t aID;
      		Bal_t aBal;       

      	public:       

      		cAccount();                       
      		void Read (Infile_t &Infile);     
      		void Print (Outfile_t &Outfile);  
      		void Display();                   
      	    int compID2ID(cAccount NewAccount);      		   

      };// end cAccount    
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      class cLList
	  {
		private:

			struct LLElt_t
			{
				cAccount Account;
				LLElt_t * Link;
			};
									//Link//

			typedef LLElt_t * Link_t;
			Link_t Head;	

			cLList(){Head=NULL;} //default constructor		

		public:
			void Insert(Link_t &Pred,Link_t &Start,cAccount NewAccount); 
			void Search4Pred(Link_t &Pred,Link_t Start, cAccount Account);  
			void Add(Link_t &Start, cAccount NewAccount); 
			void Load(Link_t &Start);  
			void Display(Link_t Start);
			void Print(Link_t Start);  

	};//end cLList

//*************************************************************************************************
      			            /* cAccount Function Implementations */       
//*************************************************************************************************
      cAccount::cAccount()
      {
		  strcpy(fname,"");
      	  strcpy(lname,"");                                                
      	  aID=0;
      	  aBal=0;  
	  
	  }// end cAccount::cAccount       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- 
      void cAccount::Read(Infile_t &Infile)
	  { Infile>>aID>>lname>>fname>>aBal;}// end cAccount::Read              
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Print(Outfile_t &Outfile)  
      {
	      Outfile<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl; 
      	  Outfile<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;      
      	  Outfile<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl; 
      	  Outfile<<"------------------------------------------------"<<endl;  
  
	  }// end cAccount::Print           
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Display()
      {
	      cout<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl;
      	  cout<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;        
      	  cout<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl;
      	  cout<<"------------------------------------------------"<<endl;       
 
      }// end cAccount::Display       
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      int cAccount::compID2ID(cAccount NewAccount)
      {
		  int count;
      	  count=0;       

      	  if(this->aID > NewAccount.aID)
      	  { count=-1;}// end if     

	      else if(this->aID < NewAccount.aID)       
      	  { count=1; }// end else if       

		  else
      	  { count=0;}//end else       

      	  return count;

      }// end cAccount::compID2ID    

//*************************************************************************************************
      			            /* cLList Function Implementations */       
//*************************************************************************************************

	  void cLList::Insert(Link_t &Pred,Link_t &Start,cAccount NewAccount)
      {
          Link_t Curr;
      	  Curr=new(LLEle_t);	
      	  Curr->Account=NewAccount; 
 
      	  if(Pred!=NULL)
      	  {
		      Curr->Link=Pred->Link;        
      		  Pred->Link=Curr;
      	  }    
	      else
      	  {
      		  Curr->Link = Start;
      		  Start = Curr;
      	  }

      };// end Insert       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Search4Pred(Link_t &Pred,Link_t Start, cAccount Account)
      {
	      bool Done=false; 
      	  Link_t Curr;
      	  Curr=Start;
      	  Pred=NULL;       

     	  while((Done!=true)&&(Curr!=NULL))
      	  {
			  if(Curr->Account.compID2ID(Account)>0)   
      		  {
			      Pred=Curr;
      			  Curr=Pred->Link;
      		  }
      		  else
      		  { Done=true;}
      	  }//end while
      }// end Search4Pred       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Add(Link_t &Start, cAccount NewAccount)
      {
	      Link_t Pred;

      	  Search4Pred(Pred,Start,NewAccount);               
      	  Insert(Pred,Start,NewAccount);

	  }// end Add       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Load(Link_t &Start)
      {
	      Filename_t Filename;
      	  Infile_t Infile;
      	  Link_t Curr=0; 
      	  Link_t Pred=0; 
	      cout<<"Program Starting.........."<<endl;
      	  cout<<"Begining Load.........."<<endl<<endl;
      	  cout<<"Enter the name of the data file to be used:"<<endl;  
      	  cin>>Filename;
      	  Infile.open(Filename,ios::in);
      	  cAccount NewAccount; 
      	  NewAccount.Read(Infile);
      	  while(!Infile.eof())
      	  {
		      Add(Start,NewAccount);
      		  NewAccount.Read(Infile);

      	  }//end while
 
      	  Infile.close();
      	  cout<<"Read Complete........."<<endl;
	      cout<<"Load Complete........."<<endl;

      };//end load
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Display(Link_t Start)
      {
	      Link_t Curr;
      	  Curr=Start;
      	  Name_t choice;
      	  cout<<"Would you like to view the output file?"<<endl;
      	  cout<<"(YES or NO)"<<endl;
      	  cin>>choice;

      	  if(strcmp(choice,"YES")==0||strcmp(choice,"Yes")==0||strcmp(choice,"yes")==0) 
      	  {
			  cout<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;       

      		  while(Curr!=NULL)                                             
      		  {
			      Curr->Account.Display();
      			  Curr=Curr->Link;

      		  }//end while

			  cout<<endl;
			  cout<<"Moving to next process.........."<<endl<<endl;

      	  }//end if
      	  else
      	  {
		      cout<<"Very Well.........."<<endl;
		      cout<<"Moving to next process.........."<<endl<<endl;
      	  }

      };// end Display
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Print(Link_t Start)
	  {
	      Link_t Curr;
      	  Curr=Start; 
      	  Filename_t Filename;
      	  Outfile_t Outfile;
      	  cout<<"Enter the name of the output file: "<<endl;
      	  cin>>Filename; 
      	  Outfile.open(Filename,ios::out);
      	  Outfile<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;

      	  while(Curr!=NULL)
      	  {
			  Curr->Account.Print(Outfile);
      		  Curr=Curr->Link;

      	  }//end while       

      	  Outfile.close();
      	  cout<<"Write Sucessful.........."<<endl<<endl;

      };// end Print
      
//*************************************************************************************************
      					                       /* MAIN */       
//*************************************************************************************************

      int main()
      {
		  int COUNT=0; 
      	  Link_t Start=NULL; 
      	  Link_t Avail=NULL;
	  	  cAccount Account;
		  cLList List;
      	  Infile_t Infile;

          /* FUNCTION CALLS */

      	  List.Load(Start);
      	  List.Display(Start);
      	  List.Print(Start);
      	  
      	  return 0;

      }// end main       
//*************************************************************************************************
				                   /* END OF SOURCE CODE */
//*************************************************************************************************

Recommended Answers

All 4 Replies

Hey everyone here are my updated errors, and code, i have gotten them down too three now

Errors:
1>assign10.cpp(273) : error C2065: 'Start' : undeclared identifier
1>assign10.cpp(274) : error C2065: 'Start' : undeclared identifier
1>assign10.cpp(275) : error C2065: 'Start' : undeclared identifier

Code:

/*	Devang N. Joshi
	CSCI 208
	Assignment 10
	Linked List Class
*/

#include <iostream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <fstream>
using namespace std;

//*************************************************************************************************  
      				                   /* Global Variables */    
//*************************************************************************************************
 
    const int NAMESIZE=25;
    const int FILENAME=51;
    const int MAXLISTSIZE=200;       
  
    typedef char Name_t[NAMESIZE];
    typedef char Filename_t[FILENAME];
    typedef int ID_t;
    typedef double Bal_t;
    typedef fstream Infile_t;
    typedef fstream Outfile_t;
       
//*************************************************************************************************
      				               /* Class Declerations */   
//*************************************************************************************************

    class cAccount
    {
		private:
			
			Name_t fname;
      		Name_t lname;
      		ID_t aID;
      		Bal_t aBal;       

      	public:       

      		cAccount();                       
      		void Read (Infile_t &Infile);     
      		void Print (Outfile_t &Outfile);  
      		void Display();                   
      	    int compID2ID(cAccount NewAccount);      		   

      };// end cAccount    
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      class cLList
	  {
		private:

			struct LLElt_t
			{
				cAccount Account;
				LLElt_t * Link;
			};
									//Link//

			typedef LLElt_t * Link_t;
			Link_t Start;	

			
		public:
			void Insert(Link_t &Pred,Link_t &Start,cAccount NewAccount); 
			void Search4Pred(Link_t &Pred,Link_t Start, cAccount Account);  
			void Add(Link_t &Start, cAccount NewAccount); 
			void Load(Link_t &Start);  
			void Display(Link_t Start);
			void Print(Link_t Start);  

	};//end cLList

//*************************************************************************************************
      			            /* cAccount Function Implementations */       
//*************************************************************************************************
      cAccount::cAccount()
      {
		  strcpy(fname,"");
      	  strcpy(lname,"");                                                
      	  aID=0;
      	  aBal=0;  
	  
	  }// end cAccount::cAccount       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- 
      void cAccount::Read(Infile_t &Infile)
	  { Infile>>aID>>lname>>fname>>aBal;}// end cAccount::Read              
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Print(Outfile_t &Outfile)  
      {
	      Outfile<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl; 
      	  Outfile<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;      
      	  Outfile<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl; 
      	  Outfile<<"------------------------------------------------"<<endl;  
  
	  }// end cAccount::Print           
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Display()
      {
	      cout<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl;
      	  cout<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;        
      	  cout<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl;
      	  cout<<"------------------------------------------------"<<endl;       
 
      }// end cAccount::Display       
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      int cAccount::compID2ID(cAccount NewAccount)
      {
		  int count;
      	  count=0;       

      	  if(this->aID > NewAccount.aID)
      	  { count=-1;}// end if     

	      else if(this->aID < NewAccount.aID)       
      	  { count=1; }// end else if       

		  else
      	  { count=0;}//end else       

      	  return count;

      }// end cAccount::compID2ID    

//*************************************************************************************************
      			            /* cLList Function Implementations */       
//*************************************************************************************************

	  void cLList::Insert(Link_t &Pred,Link_t &Start,cAccount NewAccount)
      {
          Link_t Curr;
		  Curr=new(LLElt_t);
      	  Curr->Account=NewAccount; 
 
      	  if(Pred!=NULL)
      	  {
		      Curr->Link=Pred->Link;        
      		  Pred->Link=Curr;
      	  }    
	      else
      	  {
      		  Curr->Link = Start;
      		  Start = Curr;
      	  }

      };// end Insert       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Search4Pred(Link_t &Pred,Link_t Start, cAccount Account)
      {
	      bool Done=false; 
      	  Link_t Curr;
      	  Curr=Start;
      	  Pred=NULL;       

     	  while((Done!=true)&&(Curr!=NULL))
      	  {
			  if(Curr->Account.compID2ID(Account)>0)   
      		  {
			      Pred=Curr;
      			  Curr=Pred->Link;
      		  }
      		  else
      		  { Done=true;}
      	  }//end while
      }// end Search4Pred       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Add(Link_t &Start, cAccount NewAccount)
      {
	      Link_t Pred;

      	  Search4Pred(Pred,Start,NewAccount);               
      	  Insert(Pred,Start,NewAccount);

	  }// end Add       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Load(Link_t &Start)
      {
	      Filename_t Filename;
      	  Infile_t Infile;
      	  Link_t Curr=0; 
      	  Link_t Pred=0; 
	      cout<<"Program Starting.........."<<endl;
      	  cout<<"Begining Load.........."<<endl<<endl;
      	  cout<<"Enter the name of the data file to be used:"<<endl;  
      	  cin>>Filename;
      	  Infile.open(Filename,ios::in);
      	  cAccount NewAccount; 
      	  NewAccount.Read(Infile);
      	  while(!Infile.eof())
      	  {
		      Add(Start,NewAccount);
      		  NewAccount.Read(Infile);

      	  }//end while
 
      	  Infile.close();
      	  cout<<"Read Complete........."<<endl;
	      cout<<"Load Complete........."<<endl;

      };//end load
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Display(Link_t Start)
      {
	      Link_t Curr;
      	  Curr=Start;
      	  Name_t choice;
      	  cout<<"Would you like to view the output file?"<<endl;
      	  cout<<"(YES or NO)"<<endl;
      	  cin>>choice;

      	  if(strcmp(choice,"YES")==0||strcmp(choice,"Yes")==0||strcmp(choice,"yes")==0) 
      	  {
			  cout<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;       

      		  while(Curr!=NULL)                                             
      		  {
			      Curr->Account.Display();
      			  Curr=Curr->Link;

      		  }//end while

			  cout<<endl;
			  cout<<"Moving to next process.........."<<endl<<endl;

      	  }//end if
      	  else
      	  {
		      cout<<"Very Well.........."<<endl;
		      cout<<"Moving to next process.........."<<endl<<endl;
      	  }

      };// end Display
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Print(Link_t Start)
	  {
	      Link_t Curr;
      	  Curr=Start; 
      	  Filename_t Filename;
      	  Outfile_t Outfile;
      	  cout<<"Enter the name of the output file: "<<endl;
      	  cin>>Filename; 
      	  Outfile.open(Filename,ios::out);
      	  Outfile<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;

      	  while(Curr!=NULL)
      	  {
			  Curr->Account.Print(Outfile);
      		  Curr=Curr->Link;

      	  }//end while       

      	  Outfile.close();
      	  cout<<"Write Sucessful.........."<<endl<<endl;

      };// end Print
      
//*************************************************************************************************
      					                       /* MAIN */       
//*************************************************************************************************

      int main()
      {
		  cAccount Account;
		  cLList List;
		  int COUNT=0; 
      	  Infile_t Infile;

          /* FUNCTION CALLS */

      	  List.Load(Start);
      	  List.Display(Start);
      	  List.Print(Start);
      	  
      	  return 0;

      }// end main       
//*************************************************************************************************
				                   /* END OF SOURCE CODE */
//*************************************************************************************************

Hey everyone here are my updated errors, and code, i have gotten them down too three now

Errors:
1>assign10.cpp(273) : error C2065: 'Start' : undeclared identifier
1>assign10.cpp(274) : error C2065: 'Start' : undeclared identifier
1>assign10.cpp(275) : error C2065: 'Start' : undeclared identifier

break the error down into pieces:
Start -- must be something wrong with it
undeclared -- what does this word mean?
identifier -- what about this word?

Hey everyone, ok so looking at my code, I found that I was calling start for no good reason in those list functions, because the variable start is a private member of the list class and because those functions are public members of the class they can access start......

Long story short, I have now gotten past the build errors and I am now incountering run-time errors. Here is the major error spot found by the debugger:

int cAccount::compID2ID(cAccount NewAccount)
      {
	 int count;
      	  count=0;       

      	  if(this->aID > NewAccount.aID) //<-----breaks here
      	  { count=-1;}// end if

after searching the error, I read that the error code I was given by Visual Studio refers to a bad variable so I have to say that either the program is crashing on aID or the "newaID".

With this I am kinda stuck, because I have already initilized the aID variable using the default constructor.

Is there something I am just missing flat out?

Here is the new source code:

/*	Devang N. Joshi
	CSCI 208
	Assignment 10
	Linked List Class
*/

#include <iostream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <fstream>
using namespace std;

//*************************************************************************************************  
      				                   /* Global Variables */    
//*************************************************************************************************
 
    const int NAMESIZE=25;
    const int FILENAME=51;
    const int MAXLISTSIZE=200;       
  
    typedef char Name_t[NAMESIZE];
    typedef char Filename_t[FILENAME];
    typedef int ID_t;
    typedef double Bal_t;
    typedef fstream Infile_t;
    typedef fstream Outfile_t;
       
//*************************************************************************************************
      				               /* Class Declerations */   
//*************************************************************************************************

    class cAccount
    {
		private:
			
			Name_t fname;
      		Name_t lname;
      		ID_t aID;
      		Bal_t aBal;       

      	public:       

      		cAccount();                       
      		void Read (Infile_t &Infile);     
      		void Print (Outfile_t &Outfile);  
      		void Display();                   
      	    int compID2ID(cAccount NewAccount);      		   

      };// end cAccount    
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      class cLList
	  {
		private:

			struct LLElt_t
			{
				cAccount Account;
				LLElt_t * Link;
			};
									//Link//

			typedef LLElt_t * Link_t;
			Link_t Start;	

			
		public:
			void Insert(Link_t &Pred,cAccount NewAccount); 
			void Search4Pred(Link_t &Pred,cAccount Account);  
			void Add(cAccount NewAccount); 
			void Load();  
			void Display();
			void Print();  

	};//end cLList

//*************************************************************************************************
      			            /* cAccount Function Implementations */       
//*************************************************************************************************
      cAccount::cAccount()
      {
		  strcpy(fname,"");
      	  strcpy(lname,"");                                                
      	  aID=0;
      	  aBal=0;  
	  
	  }// end cAccount::cAccount       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_- 
      void cAccount::Read(Infile_t &Infile)
	  { Infile>>aID>>lname>>fname>>aBal;}// end cAccount::Read              
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Print(Outfile_t &Outfile)  
      {
	      Outfile<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl; 
      	  Outfile<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;      
      	  Outfile<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl; 
      	  Outfile<<"------------------------------------------------"<<endl;  
  
	  }// end cAccount::Print           
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      void cAccount::Display()
      {
	      cout<<setw(10)<<"ACCOUNT-ID: "<<aID<<endl;
      	  cout<<setw(10)<<"ACCOUNT NAME: "<<lname<<","<<fname<<endl;        
      	  cout<<setw(10)<<"ACCOUNT BALANCE: $"<<aBal<<endl;
      	  cout<<"------------------------------------------------"<<endl;       
 
      }// end cAccount::Display       
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
      int cAccount::compID2ID(cAccount NewAccount)
      {
		  int count;
      	  count=0;       

      	  if(this->aID > NewAccount.aID)
      	  { count=-1;}// end if     

	      else if(this->aID < NewAccount.aID)       
      	  { count=1; }// end else if       

		  else
      	  { count=0;}//end else       

      	  return count;

      }// end cAccount::compID2ID   

//*************************************************************************************************
      			            /* cLList Function Implementations */       
//*************************************************************************************************

	  void cLList::Insert(Link_t &Pred,cAccount NewAccount)
      {
          Link_t Curr;
		  Curr=new(LLElt_t);
      	  Curr->Account=NewAccount; 
 
      	  if(Pred!=NULL)
      	  {
		      Curr->Link=Pred->Link;        
      		  Pred->Link=Curr;
      	  }    
	      else
      	  {
      		  Curr->Link = Start;
      		  Start = Curr;
      	  }

      };// end Insert       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Search4Pred(Link_t &Pred,cAccount Account)
      {
	      bool Done=false; 
      	  Link_t Curr;
      	  Curr=Start;
      	  Pred=NULL;       

     	  while((Done!=true)&&(Curr!=NULL))
      	  {
			  if(Curr->Account.compID2ID(Account)>0)   
      		  {
			      Pred=Curr;
      			  Curr=Pred->Link;
      		  }
      		  else
      		  { Done=true;}
      	  }//end while
      }// end Search4Pred       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Add(cAccount NewAccount)
      {
	      Link_t Pred;

      	  Search4Pred(Pred,NewAccount);               
      	  Insert(Pred,NewAccount);

	  }// end Add       
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Load()
      {
	      Filename_t Filename;
      	  Infile_t Infile;
      	  Link_t Curr=0; 
      	  Link_t Pred=0; 
	      cout<<"Program Starting.........."<<endl;
      	  cout<<"Begining Load.........."<<endl<<endl;
      	  cout<<"Enter the name of the data file to be used:"<<endl;  
      	  cin>>Filename;
      	  Infile.open(Filename,ios::in);
      	  cAccount NewAccount; 
      	  NewAccount.Read(Infile);
      	  while(!Infile.eof())
      	  {
		      Add(NewAccount);
      		  NewAccount.Read(Infile);

      	  }//end while
 
      	  Infile.close();
      	  cout<<"Read Complete........."<<endl;
	      cout<<"Load Complete........."<<endl;

      };//end load
 //_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Display()
      {
	      Link_t Curr;
      	  Curr=Start;
      	  Name_t choice;
      	  cout<<"Would you like to view the output file?"<<endl;
      	  cout<<"(YES or NO)"<<endl;
      	  cin>>choice;

      	  if(strcmp(choice,"YES")==0||strcmp(choice,"Yes")==0||strcmp(choice,"yes")==0) 
      	  {
			  cout<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;       

      		  while(Curr!=NULL)                                             
      		  {
			      Curr->Account.Display();
      			  Curr=Curr->Link;

      		  }//end while

			  cout<<endl;
			  cout<<"Moving to next process.........."<<endl<<endl;

      	  }//end if
      	  else
      	  {
		      cout<<"Very Well.........."<<endl;
		      cout<<"Moving to next process.........."<<endl<<endl;
      	  }

      };// end Display
//_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-
	  void cLList::Print()
	  {
	      Link_t Curr;
      	  Curr=Start; 
      	  Filename_t Filename;
      	  Outfile_t Outfile;
      	  cout<<"Enter the name of the output file: "<<endl;
      	  cin>>Filename; 
      	  Outfile.open(Filename,ios::out);
      	  Outfile<<setw(20)<<"ACCOUNT-DATA"<<endl<<endl;

      	  while(Curr!=NULL)
      	  {
			  Curr->Account.Print(Outfile);
      		  Curr=Curr->Link;

      	  }//end while       

      	  Outfile.close();
      	  cout<<"Write Sucessful.........."<<endl<<endl;

      };// end Print
      
//*************************************************************************************************
      					                       /* MAIN */       
//*************************************************************************************************

      int main()
      {
		  cAccount Account;
		  cLList List;
		  int COUNT=0; 
      	  Infile_t Infile;

          /* FUNCTION CALLS */

      	  List.Load();
      	  List.Display();
      	  List.Print();
      	  
      	  return 0;

      }// end main       
//*************************************************************************************************
				                   /* END OF SOURCE CODE */
//*************************************************************************************************

I figured out the issue just for those interested, the runtime issues were because I did not include a default constructor for the cLList class to set the start variable and so one I did that the code runs with no problems

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.