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

  • Home
  • SEARCH
  • 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 1052547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T17:06:40+00:00 2026-05-16T17:06:40+00:00

//// header file #ifndef _SECTION_ #define _SECTION_ #include <map> #include Employee.h using namespace std;

  • 0
//// header file

#ifndef _SECTION_
#define _SECTION_

#include <map>
#include "Employee.h"
using namespace std;

class Section {
 private:
  char* m_sectionName;
  Employee* m_director;
  Employee* m_viceDirector;
  typedef multimap<string,Employee*> m_employees; 

 public:

  Section (char* name);
  Section(const Section& section); 
  ~Section();

  const char* GetSectionName () const { return m_sectionName; }
  const Employee* GetDirector () const { return m_director; } ///////////////check
  const Employee* GetViceDirector () const {return m_viceDirector; } ///////////// check

  void SetSectionName (const char* newName);
  Employee* SetDirector (Employee& newDirector); ///////////// check
  Employee* SetViceDirector (Employee& newViceDirector); ///////////// check

  void Show () const;
  void ShowEmployess() const;
  void AddEmployee (Employee newEmployee);
  Employee RemoveEmployee (string id); 

  int GetMinEmployeeWage () const;
  int GetMaxEmployeeWage () const;
  int AvgMaxEmployeeWage () const;
  int GetNumOfEmployee () const;
  int GetSumOfExpenses () const;  
};

#endif



////// cpp


#include "Section.h"

Section::Section (char* name)
{
 SetSectionName(name);
}


Section::Section(const Section& otherSection) {
 SetSectionName(otherSection.GetSectionName());
 m_director = otherSection.m_director; //////// check
 m_viceDirector = otherSection.m_viceDirector; /////// check
}

Section::~Section(){
 delete [] m_sectionName;
}


void Section::SetSectionName (const char* newName){
 m_sectionName = new char[strlen(newName)+1];
 strcpy(m_sectionName, newName);
}


Employee* Section::SetDirector (Employee& newDirector) {
 Employee* oldDirector = m_director;
 m_director = &newDirector;
 return oldDirector;
}

Employee* Section::SetViceDirector (Employee& newViceDirector) {
 Employee* oldViceDirector = m_viceDirector;
 m_viceDirector = &newViceDirector;
 return oldViceDirector;
}

void Section::Show() const {
 cout <<"Section :"<<m_sectionName<<endl;
 cout <<"Director :"<<m_director<<endl;
 cout <<"ViceDirector :"<<m_viceDirector<<endl;
}


/*void Section::ShowEmployess() const {
 m_employees::iterator Iterator;
 for (Iterator index = m_employees.begin(); index != m_employees.end(); ++index) {
  Iterator->
 }
}*/

///here the problem !!
void Section::AddEmployee(Employee newEmployee) {
 m_employees.insert(make_pair((string)(newEmployee->GetLastName()),newEmployee));
}
  • 1 1 Answer
  • 1 View
  • 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-05-16T17:06:41+00:00Added an answer on May 16, 2026 at 5:06 pm
    typedef multimap<string,Employee*> m_employees; 
    

    Makes m_employees an alias for the specialized map type. You need to define a member. Use instead:

    typedef multimap<string,Employee*> EmpMap;
    EmpMap m_employees; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Header file #ifndef IREADER_H #define IREADER_H #include <iostream> class iReader { public: iReader(); iReader(istream
in header file I have defined the following function #ifndef OS_H #define OS_H #include
Consider having the following header file (c++): myclass.hpp #ifndef MYCLASSHPP_ #define MYCLASSHPP_ namespace A
I have the following header file: #ifndef CLASSES_H #define CLASSES_H class Mouse // Handles
I'm getting a compiler error with this header file: #ifndef GAME1_H #define GAME1_H #include
So I have a base class with the following header file: #ifndef ODESolver_H #define
I have the following header file: #ifndef DATABASE_H #define DATABASE_H #include <vector> #include <iostream>
I have the following code in a header file: #ifndef BUFFER_H #define BUFFER_H #include
I have a header file like this: #ifndef __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #define __GEN_NOTE_MARKERS_TO_DEVELOPERS_HPP__ #ifdef _DEBUG //
Header file: // pe10-8arr.h -- header file for a simple list class #ifndef SIMPLEST_

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.