SlideShare a Scribd company logo
1 of 14
Download to read offline
I keep getting an error about m_pHead in printStoresInfo(); function in the cpp file.
CustomerList.h
#pragma once;
#include
#include "Store.h"
class CustomerList
{
public:
Store *m_pHead;
CustomerList();
~CustomerList();
bool addStore(Store *s);
Store *removeStore(int ID);
Store *getStore(int ID);
bool updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip);
void printStoresInfo();
};
CustomerList.cpp
#include
#include "CustomerList.h"
#include "Store.h"
using namespace std;
CustomerList::CustomerList()
{
// Default constructor
}
CustomerList::~CustomerList()
{
// Destructor
}
bool CustomerList:: addStore(Store *s)
{
//creating a new instance
s = new Store();
if(s==NULL)
return true;
}
Store *CustomerList::removeStore(int ID)
{
Store *temp, *back;
temp = m_pHead;
back = NULL;
while((temp != NULL)&&(ID != temp ->getStoreID()))
{
back=temp;
temp=temp->m_pNext;
}
if(temp==NULL)
return NULL;
else if(back==NULL)
{
m_pHead = m_pHead ->m_pNext;
return temp;
}
else
{
back -> m_pNext = temp-> m_pNext;
return temp;
}
return NULL;
}
Store *CustomerList::getStore(int ID)
{
Store *temp;
temp = m_pHead;
while((temp != NULL) && (ID != temp ->getStoreID()))
{
temp = temp->m_pNext;
}
if(temp == NULL)
return NULL;
else
{
Store *retStore = new Store;
*retStore = *temp;
retStore->m_pNext = NULL;
return retStore;
}
}
bool CustomerList::updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip)
{
return false;
}
void CustomerList::printStoresInfo()
{
Store *temp;
cout << "
=====================================================================
================ " << endl;
if(m_pHead == NULL)
{
cout << " The List is currently empty. " ;
}
else
{
temp = m_pHead;
while(temp != NULL)
{
cout << temp->m_pNext << endl;
}
}
}
Store.h
#pragma once;
#include
#include
using namespace std;
class Store
{
private:
int m_iStoreID;
char m_sStoreName[64];
char m_sAddress[64];
char m_sCity[32];
char m_sState[32];
char m_sZip[11];
public:
Store *m_pNext;
Store(); // Default constructor
Store(int ID, // Constructor
char *name,
char *addr,
char *city,
char *st,
char *zip);
~Store(); // Destructor
int getStoreID(); // Get/Set store ID
void setStoreID(int ID);
char *getStoreName(); // Get/Set store name
void setStoreName(char *name);
char *getStoreAddress(); // Get/Set store address
void setStoreAddress(char *addr);
char *getStoreCity(); // Get/Set store city
void setStoreCity(char *city);
char *getStoreState(); // Get/Set store state
void setStoreState(char *state);
char *getStoreZip(); // Get/Set store zip code
void setStoreZip(char *zip);
void printStoreInfo(); // Print all info on this store
};
Store.cpp
#include "Store.h"
#include
using namespace std;
Store::Store()
{
m_pNext = NULL;
}
Store::Store(int ID, char *name, char *addr, char *city, char *st, char *zip)
{
m_iStoreID = ID;
strcpy(m_sStoreName, name);
strcpy(m_sAddress, addr);
strcpy(m_sCity, city);
strcpy(m_sState, st);
strcpy(m_sZip, zip);
m_pNext = NULL;
}
Store::~Store()
{
// Nothing to do here
}
int Store::getStoreID()
{
return m_iStoreID;
}
void Store::setStoreID(int ID)
{
m_iStoreID = ID;
}
char *Store::getStoreName()
{
char *name = new char[strlen(m_sStoreName) + 1];
strcpy(name, m_sStoreName);
return name;
}
void Store::setStoreName(char *name)
{
strcpy(m_sStoreName, name);
}
char *Store::getStoreAddress()
{
char *addr = new char[strlen(m_sAddress) + 1];
strcpy(addr, m_sAddress);
return addr;
}
void Store::setStoreAddress(char *addr)
{
strcpy(m_sAddress, addr);
}
char *Store::getStoreCity()
{
char *city = new char[strlen(m_sCity) + 1];
strcpy(city, m_sCity);
return city;
}
void Store::setStoreCity(char *city)
{
strcpy(m_sCity, city);
}
char *Store::getStoreState()
{
char *state = new char[strlen(m_sState) + 1];
strcpy(state, m_sState);
return state;
}
void Store::setStoreState(char *state)
{
strcpy(m_sState, state);
}
char *Store::getStoreZip()
{
char *zip = new char[strlen(m_sZip) + 1];
strcpy(zip, m_sZip);
return zip;
}
void Store::setStoreZip(char *zip)
{
strcpy(m_sZip, zip);
}
void Store::printStoreInfo()
{
cout << m_iStoreID << setw(20) << m_sStoreName << setw(15) << m_sAddress
<< setw(15) << m_sCity << ", " << m_sState << setw(10) << m_sZip << " ";
}
Solution
Made changes to the following files
PROGRAM CODE:
CustomerList.cpp
/*
* CustomerList.cpp
*
* Created on: 25-Feb-2017
* Author: kasturi
*/
#include
#include "CustomerList.h"
#include "Store.h"
using namespace std;
CustomerList::CustomerList()
{
m_pHead = NULL;
// Default constructor
}
CustomerList::~CustomerList()
{
delete m_pHead;
// Destructor
}
bool CustomerList:: addStore(Store *s)
{
//creating a new instance
if(m_pHead==NULL)
{
m_pHead = new Store(s->getStoreID(),s->getStoreName(), s->getStoreAddress(), s-
>getStoreCity(), s->getStoreState(), s->getStoreZip());
return true;
}
else
{
Store * temp;
temp=m_pHead;
while(temp->m_pNext != NULL)
{
temp = temp->m_pNext;
}
temp->m_pNext = new Store(s->getStoreID(),s->getStoreName(), s->getStoreAddress(), s-
>getStoreCity(), s->getStoreState(), s->getStoreZip());
return true;
}
}
Store *CustomerList::removeStore(int ID)
{
Store *temp, *back;
temp = m_pHead;
back = NULL;
while((temp != NULL)&&(ID != temp ->getStoreID()))
{
back=temp;
temp=temp->m_pNext;
}
if(temp==NULL)
return NULL;
else if(back==NULL)
{
m_pHead = m_pHead ->m_pNext;
return temp;
}
else
{
back -> m_pNext = temp-> m_pNext;
return temp;
}
return NULL;
}
Store *CustomerList::getStore(int ID)
{
Store *temp;
temp = m_pHead;
while((temp != NULL) && (ID != temp ->getStoreID()))
{
temp = temp->m_pNext;
}
if(temp == NULL)
return NULL;
else
{
Store *retStore = new Store;
*retStore = *temp;
retStore->m_pNext = NULL;
return retStore;
}
}
bool CustomerList::updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip)
{
return false;
}
void CustomerList::printStoresInfo()
{
Store *temp;
cout << "
=====================================================================
================ " << endl;
if(m_pHead == NULL)
{
cout << " The List is currently empty. " ;
}
else
{
temp = m_pHead;
while(temp != NULL)
{
temp->printStoreInfo();
temp = temp->m_pNext;
}
}
}
Store.cpp
/*
* Store.cpp
*
* Created on: 25-Feb-2017
* Author: kasturi
*/
#include "Store.h"
#include
using namespace std;
Store::Store()
{
m_pNext = NULL;
}
Store::Store(int ID, char *name, char *addr, char *city, char *st, char *zip)
{
m_iStoreID = ID;
strcpy(m_sStoreName, name);
strcpy(m_sAddress, addr);
strcpy(m_sCity, city);
strcpy(m_sState, st);
strcpy(m_sZip, zip);
m_pNext = NULL;
}
Store::~Store()
{
// Nothing to do here
}
int Store::getStoreID()
{
return m_iStoreID;
}
void Store::setStoreID(int ID)
{
m_iStoreID = ID;
}
char *Store::getStoreName()
{
char *name = new char[strlen(m_sStoreName) + 1];
strcpy(name, m_sStoreName);
return name;
}
void Store::setStoreName(char *name)
{
strcpy(m_sStoreName, name);
}
char *Store::getStoreAddress()
{
char *addr = new char[strlen(m_sAddress) + 1];
strcpy(addr, m_sAddress);
return addr;
}
void Store::setStoreAddress(char *addr)
{
strcpy(m_sAddress, addr);
}
char *Store::getStoreCity()
{
char *city = new char[strlen(m_sCity) + 1];
strcpy(city, m_sCity);
return city;
}
void Store::setStoreCity(char *city)
{
strcpy(m_sCity, city);
}
char *Store::getStoreState()
{
char *state = new char[strlen(m_sState) + 1];
strcpy(state, m_sState);
return state;
}
void Store::setStoreState(char *state)
{
strcpy(m_sState, state);
}
char *Store::getStoreZip()
{
char *zip = new char[strlen(m_sZip) + 1];
strcpy(zip, m_sZip);
return zip;
}
void Store::setStoreZip(char *zip)
{
strcpy(m_sZip, zip);
}
void Store::printStoreInfo()
{
cout << m_iStoreID << setw(20) << m_sStoreName << setw(15) << m_sAddress
<< setw(15) << m_sCity << ", " << m_sState << setw(10) << m_sZip << " ";
}
//I used this main file for texting
simpleMain.cpp
/*
* simpleMain.cpp
*
* Created on: 25-Feb-2017
* Author: kasturi
*/
#include "Store.h"
#include "CustomerList.h"
#include
int main()
{
CustomerList list;
list.printStoresInfo();
Store s1(123, "KS Stores", "Wells Street", "New York", "New York", "A50032");
Store s2(124, "Free Stores", "Wall Street", "New York", "New York", "A50032");
Store s3(125, "Real Stores", "KC Street", "Washington", "Washington D.C",
"D50032");
list.addStore(&s1);
list.addStore(&s2);
list.addStore(&s3);
list.removeStore(124);
list.printStoresInfo();
return 0;
}
OUTPUT:
=====================================================================
================
The List is currently empty.
=====================================================================
================
123 KS Stores Wells Street New York, New York A50032
125 Real Stores KC Street Washington, Washington D.C D50032

More Related Content

Similar to I keep getting an error about m_pHead in printStoresInfo(); function.pdf

This is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfThis is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfkostikjaylonshaewe47
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfamarndsons
 
Can you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfCan you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfFashionBoutiquedelhi
 
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdfincludestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdfgalagirishp
 
Ugly code
Ugly codeUgly code
Ugly codeOdd-e
 
#include stdafx.h#include iostreamusing namespace std;cl.pdf
#include stdafx.h#include iostreamusing namespace std;cl.pdf#include stdafx.h#include iostreamusing namespace std;cl.pdf
#include stdafx.h#include iostreamusing namespace std;cl.pdfaashwini4
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing Swakriti Rathore
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Andrey Akinshin
 
12.9 Program Online shopping cart (continued) (C++)This program e.pdf
12.9 Program Online shopping cart (continued) (C++)This program e.pdf12.9 Program Online shopping cart (continued) (C++)This program e.pdf
12.9 Program Online shopping cart (continued) (C++)This program e.pdffasttracksunglass
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfarjuncollection
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorJussi Pohjolainen
 
Write a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdfWrite a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdfSANDEEPARIHANT
 
#include iostream#include stringusing namespace std;.docx
#include iostream#include stringusing namespace std;.docx#include iostream#include stringusing namespace std;.docx
#include iostream#include stringusing namespace std;.docxkatherncarlyle
 
Railway reservation
Railway reservationRailway reservation
Railway reservationSwarup Boro
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
 
Header file for an array-based implementation of the ADT bag. @f.pdf
 Header file for an array-based implementation of the ADT bag. @f.pdf Header file for an array-based implementation of the ADT bag. @f.pdf
Header file for an array-based implementation of the ADT bag. @f.pdfsudhirchourasia86
 
This is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdfThis is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdfinfo334223
 

Similar to I keep getting an error about m_pHead in printStoresInfo(); function.pdf (20)

This is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdfThis is a c++ binary search program I worked so far but still cant g.pdf
This is a c++ binary search program I worked so far but still cant g.pdf
 
Please teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdfPlease teach me how to fix the errors and where should be modified. .pdf
Please teach me how to fix the errors and where should be modified. .pdf
 
Can you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdfCan you please debug this Thank you in advance! This program is sup.pdf
Can you please debug this Thank you in advance! This program is sup.pdf
 
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdfincludestdio.h #includestdlib.h int enqueue(struct node ,.pdf
includestdio.h #includestdlib.h int enqueue(struct node ,.pdf
 
Ugly code
Ugly codeUgly code
Ugly code
 
#include stdafx.h#include iostreamusing namespace std;cl.pdf
#include stdafx.h#include iostreamusing namespace std;cl.pdf#include stdafx.h#include iostreamusing namespace std;cl.pdf
#include stdafx.h#include iostreamusing namespace std;cl.pdf
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?Что нам готовит грядущий C#7?
Что нам готовит грядущий C#7?
 
12.9 Program Online shopping cart (continued) (C++)This program e.pdf
12.9 Program Online shopping cart (continued) (C++)This program e.pdf12.9 Program Online shopping cart (continued) (C++)This program e.pdf
12.9 Program Online shopping cart (continued) (C++)This program e.pdf
 
Lab Question
Lab QuestionLab Question
Lab Question
 
So I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdfSo I already have most of the code and now I have to1. create an .pdf
So I already have most of the code and now I have to1. create an .pdf
 
C++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operatorC++: Constructor, Copy Constructor and Assignment operator
C++: Constructor, Copy Constructor and Assignment operator
 
Write a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdfWrite a C program that reads the words the user types at the command.pdf
Write a C program that reads the words the user types at the command.pdf
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
#include iostream#include stringusing namespace std;.docx
#include iostream#include stringusing namespace std;.docx#include iostream#include stringusing namespace std;.docx
#include iostream#include stringusing namespace std;.docx
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
Header file for an array-based implementation of the ADT bag. @f.pdf
 Header file for an array-based implementation of the ADT bag. @f.pdf Header file for an array-based implementation of the ADT bag. @f.pdf
Header file for an array-based implementation of the ADT bag. @f.pdf
 
String searching
String searchingString searching
String searching
 
This is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdfThis is the main file include itemh include itemList.pdf
This is the main file include itemh include itemList.pdf
 

More from flashfashioncasualwe

How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfHow does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfflashfashioncasualwe
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfflashfashioncasualwe
 
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfFocus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfflashfashioncasualwe
 
Decision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfDecision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfflashfashioncasualwe
 
Explain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfExplain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfflashfashioncasualwe
 
During a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfDuring a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfflashfashioncasualwe
 
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfExplain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfflashfashioncasualwe
 
Describe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfDescribe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfflashfashioncasualwe
 
Explain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfExplain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfflashfashioncasualwe
 
Develop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdfDevelop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdfflashfashioncasualwe
 
Describe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfDescribe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfflashfashioncasualwe
 
All answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfAll answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfflashfashioncasualwe
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfflashfashioncasualwe
 
Add to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfAdd to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfflashfashioncasualwe
 
Write an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfWrite an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfflashfashioncasualwe
 
which of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfwhich of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfflashfashioncasualwe
 
2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdfflashfashioncasualwe
 
10. Benefits and costs of International Trade Search for a newspap.pdf
10. Benefits and costs of International Trade  Search for a newspap.pdf10. Benefits and costs of International Trade  Search for a newspap.pdf
10. Benefits and costs of International Trade Search for a newspap.pdfflashfashioncasualwe
 
Why does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfWhy does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfflashfashioncasualwe
 
Use the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfUse the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfflashfashioncasualwe
 

More from flashfashioncasualwe (20)

How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdfHow does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
How does the mutation rate of speciation in the Dobzhansky- Muller m.pdf
 
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdfHello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
Hello. I need help fixing this Java Code on Eclipse. Please fix part.pdf
 
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdfFocus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
Focus on Writing 4. Supporting a Point of View Do you think Social Se.pdf
 
Decision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdfDecision-Making Across the Organization The board of trustees of a lo.pdf
Decision-Making Across the Organization The board of trustees of a lo.pdf
 
Explain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdfExplain the experience of African-Americans in the South over the co.pdf
Explain the experience of African-Americans in the South over the co.pdf
 
During a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdfDuring a diversity management session, a manager suggests that stereo.pdf
During a diversity management session, a manager suggests that stereo.pdf
 
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdfExplain why a mycoplasma PCR kit might give a negative result when u.pdf
Explain why a mycoplasma PCR kit might give a negative result when u.pdf
 
Describe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdfDescribe the difference between the MOV instruction and the LEA instr.pdf
Describe the difference between the MOV instruction and the LEA instr.pdf
 
Explain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdfExplain how enzymes work, explaining the four major types of metabol.pdf
Explain how enzymes work, explaining the four major types of metabol.pdf
 
Develop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdfDevelop an inventory management system for an electronics store. The .pdf
Develop an inventory management system for an electronics store. The .pdf
 
Describe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdfDescribe one event from your daily life when you have changed your o.pdf
Describe one event from your daily life when you have changed your o.pdf
 
All answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdfAll answers must be in your own wordsProvide a good, understandabl.pdf
All answers must be in your own wordsProvide a good, understandabl.pdf
 
C programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdfC programming tweak needed for a specific program.This is the comp.pdf
C programming tweak needed for a specific program.This is the comp.pdf
 
Add to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdfAdd to BST.java a method height() that computes the height of the tr.pdf
Add to BST.java a method height() that computes the height of the tr.pdf
 
Write an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdfWrite an awareness objective for a newly formed adolescent chemical .pdf
Write an awareness objective for a newly formed adolescent chemical .pdf
 
which of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdfwhich of these prokaryotes are most likely to be found in the immedi.pdf
which of these prokaryotes are most likely to be found in the immedi.pdf
 
2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf2. Why is only one end point observed for citric acid even though it .pdf
2. Why is only one end point observed for citric acid even though it .pdf
 
10. Benefits and costs of International Trade Search for a newspap.pdf
10. Benefits and costs of International Trade  Search for a newspap.pdf10. Benefits and costs of International Trade  Search for a newspap.pdf
10. Benefits and costs of International Trade Search for a newspap.pdf
 
Why does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdfWhy does the pattern in a shift register shift only one bit position.pdf
Why does the pattern in a shift register shift only one bit position.pdf
 
Use the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdfUse the Internet to identify three network firewalls, and create a t.pdf
Use the Internet to identify three network firewalls, and create a t.pdf
 

Recently uploaded

e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi RajagopalEADTU
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17Celine George
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...EduSkills OECD
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...Gary Wood
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFVivekanand Anglo Vedic Academy
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnershipsexpandedwebsite
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxneillewis46
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxMarlene Maheu
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...Nguyen Thanh Tu Collection
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...EADTU
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17Celine George
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxCeline George
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSean M. Fox
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文中 央社
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...Nguyen Thanh Tu Collection
 

Recently uploaded (20)

e-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopale-Sealing at EADTU by Kamakshi Rajagopal
e-Sealing at EADTU by Kamakshi Rajagopal
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...Andreas Schleicher presents at the launch of What does child empowerment mean...
Andreas Schleicher presents at the launch of What does child empowerment mean...
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
The Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDFThe Story of Village Palampur Class 9 Free Study Material PDF
The Story of Village Palampur Class 9 Free Study Material PDF
 
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community PartnershipsSpring gala 2024 photo slideshow - Celebrating School-Community Partnerships
Spring gala 2024 photo slideshow - Celebrating School-Community Partnerships
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"Mattingly "AI & Prompt Design: Named Entity Recognition"
Mattingly "AI & Prompt Design: Named Entity Recognition"
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17How to Send Pro Forma Invoice to Your Customers in Odoo 17
How to Send Pro Forma Invoice to Your Customers in Odoo 17
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading RoomSternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
Sternal Fractures & Dislocations - EMGuidewire Radiology Reading Room
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
24 ĐỀ THAM KHẢO KÌ THI TUYỂN SINH VÀO LỚP 10 MÔN TIẾNG ANH SỞ GIÁO DỤC HẢI DƯ...
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 

I keep getting an error about m_pHead in printStoresInfo(); function.pdf

  • 1. I keep getting an error about m_pHead in printStoresInfo(); function in the cpp file. CustomerList.h #pragma once; #include #include "Store.h" class CustomerList { public: Store *m_pHead; CustomerList(); ~CustomerList(); bool addStore(Store *s); Store *removeStore(int ID); Store *getStore(int ID); bool updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip); void printStoresInfo(); }; CustomerList.cpp #include #include "CustomerList.h" #include "Store.h" using namespace std; CustomerList::CustomerList() { // Default constructor } CustomerList::~CustomerList() { // Destructor } bool CustomerList:: addStore(Store *s) {
  • 2. //creating a new instance s = new Store(); if(s==NULL) return true; } Store *CustomerList::removeStore(int ID) { Store *temp, *back; temp = m_pHead; back = NULL; while((temp != NULL)&&(ID != temp ->getStoreID())) { back=temp; temp=temp->m_pNext; } if(temp==NULL) return NULL; else if(back==NULL) { m_pHead = m_pHead ->m_pNext; return temp; } else { back -> m_pNext = temp-> m_pNext; return temp; } return NULL; } Store *CustomerList::getStore(int ID) { Store *temp; temp = m_pHead; while((temp != NULL) && (ID != temp ->getStoreID()))
  • 3. { temp = temp->m_pNext; } if(temp == NULL) return NULL; else { Store *retStore = new Store; *retStore = *temp; retStore->m_pNext = NULL; return retStore; } } bool CustomerList::updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip) { return false; } void CustomerList::printStoresInfo() { Store *temp; cout << " ===================================================================== ================ " << endl; if(m_pHead == NULL) { cout << " The List is currently empty. " ; } else { temp = m_pHead; while(temp != NULL) { cout << temp->m_pNext << endl; } } }
  • 4. Store.h #pragma once; #include #include using namespace std; class Store { private: int m_iStoreID; char m_sStoreName[64]; char m_sAddress[64]; char m_sCity[32]; char m_sState[32]; char m_sZip[11]; public: Store *m_pNext; Store(); // Default constructor Store(int ID, // Constructor char *name, char *addr, char *city, char *st, char *zip); ~Store(); // Destructor int getStoreID(); // Get/Set store ID void setStoreID(int ID); char *getStoreName(); // Get/Set store name void setStoreName(char *name); char *getStoreAddress(); // Get/Set store address void setStoreAddress(char *addr); char *getStoreCity(); // Get/Set store city void setStoreCity(char *city); char *getStoreState(); // Get/Set store state void setStoreState(char *state); char *getStoreZip(); // Get/Set store zip code void setStoreZip(char *zip);
  • 5. void printStoreInfo(); // Print all info on this store }; Store.cpp #include "Store.h" #include using namespace std; Store::Store() { m_pNext = NULL; } Store::Store(int ID, char *name, char *addr, char *city, char *st, char *zip) { m_iStoreID = ID; strcpy(m_sStoreName, name); strcpy(m_sAddress, addr); strcpy(m_sCity, city); strcpy(m_sState, st); strcpy(m_sZip, zip); m_pNext = NULL; } Store::~Store() { // Nothing to do here } int Store::getStoreID() { return m_iStoreID; } void Store::setStoreID(int ID) {
  • 6. m_iStoreID = ID; } char *Store::getStoreName() { char *name = new char[strlen(m_sStoreName) + 1]; strcpy(name, m_sStoreName); return name; } void Store::setStoreName(char *name) { strcpy(m_sStoreName, name); } char *Store::getStoreAddress() { char *addr = new char[strlen(m_sAddress) + 1]; strcpy(addr, m_sAddress); return addr; } void Store::setStoreAddress(char *addr) { strcpy(m_sAddress, addr); } char *Store::getStoreCity() { char *city = new char[strlen(m_sCity) + 1]; strcpy(city, m_sCity); return city; } void Store::setStoreCity(char *city) {
  • 7. strcpy(m_sCity, city); } char *Store::getStoreState() { char *state = new char[strlen(m_sState) + 1]; strcpy(state, m_sState); return state; } void Store::setStoreState(char *state) { strcpy(m_sState, state); } char *Store::getStoreZip() { char *zip = new char[strlen(m_sZip) + 1]; strcpy(zip, m_sZip); return zip; } void Store::setStoreZip(char *zip) { strcpy(m_sZip, zip); } void Store::printStoreInfo() { cout << m_iStoreID << setw(20) << m_sStoreName << setw(15) << m_sAddress << setw(15) << m_sCity << ", " << m_sState << setw(10) << m_sZip << " "; } Solution Made changes to the following files
  • 8. PROGRAM CODE: CustomerList.cpp /* * CustomerList.cpp * * Created on: 25-Feb-2017 * Author: kasturi */ #include #include "CustomerList.h" #include "Store.h" using namespace std; CustomerList::CustomerList() { m_pHead = NULL; // Default constructor } CustomerList::~CustomerList() { delete m_pHead; // Destructor } bool CustomerList:: addStore(Store *s) { //creating a new instance if(m_pHead==NULL) { m_pHead = new Store(s->getStoreID(),s->getStoreName(), s->getStoreAddress(), s- >getStoreCity(), s->getStoreState(), s->getStoreZip()); return true; } else { Store * temp; temp=m_pHead; while(temp->m_pNext != NULL)
  • 9. { temp = temp->m_pNext; } temp->m_pNext = new Store(s->getStoreID(),s->getStoreName(), s->getStoreAddress(), s- >getStoreCity(), s->getStoreState(), s->getStoreZip()); return true; } } Store *CustomerList::removeStore(int ID) { Store *temp, *back; temp = m_pHead; back = NULL; while((temp != NULL)&&(ID != temp ->getStoreID())) { back=temp; temp=temp->m_pNext; } if(temp==NULL) return NULL; else if(back==NULL) { m_pHead = m_pHead ->m_pNext; return temp; } else { back -> m_pNext = temp-> m_pNext; return temp; } return NULL; } Store *CustomerList::getStore(int ID) { Store *temp; temp = m_pHead;
  • 10. while((temp != NULL) && (ID != temp ->getStoreID())) { temp = temp->m_pNext; } if(temp == NULL) return NULL; else { Store *retStore = new Store; *retStore = *temp; retStore->m_pNext = NULL; return retStore; } } bool CustomerList::updateStore(int ID, char *name, char *addr, char *city, char *st, char *zip) { return false; } void CustomerList::printStoresInfo() { Store *temp; cout << " ===================================================================== ================ " << endl; if(m_pHead == NULL) { cout << " The List is currently empty. " ; } else { temp = m_pHead; while(temp != NULL) { temp->printStoreInfo(); temp = temp->m_pNext; }
  • 11. } } Store.cpp /* * Store.cpp * * Created on: 25-Feb-2017 * Author: kasturi */ #include "Store.h" #include using namespace std; Store::Store() { m_pNext = NULL; } Store::Store(int ID, char *name, char *addr, char *city, char *st, char *zip) { m_iStoreID = ID; strcpy(m_sStoreName, name); strcpy(m_sAddress, addr); strcpy(m_sCity, city); strcpy(m_sState, st); strcpy(m_sZip, zip); m_pNext = NULL; } Store::~Store() { // Nothing to do here } int Store::getStoreID() { return m_iStoreID; } void Store::setStoreID(int ID) {
  • 12. m_iStoreID = ID; } char *Store::getStoreName() { char *name = new char[strlen(m_sStoreName) + 1]; strcpy(name, m_sStoreName); return name; } void Store::setStoreName(char *name) { strcpy(m_sStoreName, name); } char *Store::getStoreAddress() { char *addr = new char[strlen(m_sAddress) + 1]; strcpy(addr, m_sAddress); return addr; } void Store::setStoreAddress(char *addr) { strcpy(m_sAddress, addr); } char *Store::getStoreCity() { char *city = new char[strlen(m_sCity) + 1]; strcpy(city, m_sCity); return city; } void Store::setStoreCity(char *city) { strcpy(m_sCity, city); } char *Store::getStoreState() { char *state = new char[strlen(m_sState) + 1]; strcpy(state, m_sState);
  • 13. return state; } void Store::setStoreState(char *state) { strcpy(m_sState, state); } char *Store::getStoreZip() { char *zip = new char[strlen(m_sZip) + 1]; strcpy(zip, m_sZip); return zip; } void Store::setStoreZip(char *zip) { strcpy(m_sZip, zip); } void Store::printStoreInfo() { cout << m_iStoreID << setw(20) << m_sStoreName << setw(15) << m_sAddress << setw(15) << m_sCity << ", " << m_sState << setw(10) << m_sZip << " "; } //I used this main file for texting simpleMain.cpp /* * simpleMain.cpp * * Created on: 25-Feb-2017 * Author: kasturi */ #include "Store.h" #include "CustomerList.h" #include int main() { CustomerList list; list.printStoresInfo();
  • 14. Store s1(123, "KS Stores", "Wells Street", "New York", "New York", "A50032"); Store s2(124, "Free Stores", "Wall Street", "New York", "New York", "A50032"); Store s3(125, "Real Stores", "KC Street", "Washington", "Washington D.C", "D50032"); list.addStore(&s1); list.addStore(&s2); list.addStore(&s3); list.removeStore(124); list.printStoresInfo(); return 0; } OUTPUT: ===================================================================== ================ The List is currently empty. ===================================================================== ================ 123 KS Stores Wells Street New York, New York A50032 125 Real Stores KC Street Washington, Washington D.C D50032