Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8901985
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T01:29:55+00:00 2026-06-15T01:29:55+00:00

I have been receiving this error and it appears to be too vague for

  • 0

I have been receiving this error and it appears to be too vague for a Google search so I am handing it over to you! I am trying to create a linked list object that holds Account objects.

#include "Customer.h"
#include "LinkedList.h"
#include "Account.h"
#include "Mortgage.h"
#include "CurrentAcc.h"
#include "JuniorAcc.h"
#include "transaction.h"

#include <iostream>
#include <string>

using namespace std;


string name;
string address;
string telNo;
char gender;
string dateOfBirth;
list<Account> accList;  // Error
list<Mortgage> mortList;  //Error

I feel that I am not properly declaring my Linked Lists but cannot think of how else to do it.

The next piece of code I feel is as a result of my bad declaration.

void Customer::openCurrentAccount(int numb, double bal, int cl, string type, double Interest){
Current acc(numb,bal,cl,type,Interest); //Error - Expression must have class type.
accList.add(acc);
}

And here is the creation of my Linked List class .h file.

#pragma once

#include <iostream>
using namespace std;

template <class T>
class node;

template <class T>

class list
{

public:
list() { head = tail = NULL; }
~list();
void add(T &obj);
T remove(int ID);
void print(ostream &out);
T search(int ID);

private:
node<T> *head, *tail;
};

template <class T>
class node

{
public:
node() {next = NULL;}
//private:
T data;
node *next;
};

template <class T>
list<T>::~list()
{
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T01:29:57+00:00Added an answer on June 15, 2026 at 1:29 am

    You’re defining your own class called list in the global namespace, and also putting using namespace std; in its header to dump the entire standard library into the global namespace. This means that you have two templates called list available in the global namespace, which will cause ambiguities and hence compile errors.

    You should:

    • avoid putting using namespace std; in source files
    • never put it in headers, since it imposes namespace pollution on anyone who uses that header
    • avoid putting your own declarations in the global namespace
    • avoid giving your own declarations the same name as things in the standard library
    • use standard library facilities rather than writing your own versions.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been receiving this error for a while when using devenv on an
I have been receiving errors when trying to save and run this Python 3.1
I have recently been receiving the following error whenever I am asked to supply
I have been running a cron job on Google App Engine for over a
I've been receiving this error for most of the day now, and my brain
Have been trying to encrypt an xml file to a string so that I
Have been working on this question for a couple hours and have come close
Have have been trying to make a validator for my xml files. I have
I'm receiving the error 'currentUpdateMethod' undeclared (first use in this function). The variable this
Have been fighting this for two days and am very frustrated but feel like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.