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 8503807
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:51:26+00:00 2026-06-11T01:51:26+00:00

I just split a C++ program that i’m writing up into multiple files. Now

  • 0

I just split a C++ program that i’m writing up into multiple files.

Now I am getting this error for every member function declaration.

What am I doing wrong?

 3 class Office{
  4     private:
  5         static const int IDLE = 0, BUSY = 1;
  6         const int num_tellers;
  7         int students_served;
  8 
  9         vector<double> que;                                                   // a vector que which holds the arrival times of students entering an Office
 10         vector<int> tellers;                                                 // a vector to hold the status (IDLE or BUSY) of the tellers                *** INITIALIZED TO SIZE tellers[num_tellers] IN CONSTRUCTOR ***
 11 
 12 
 13         variate_generator<mt19937, exponential_distribution<> > serve_time;  // random variable, determines the time it takes a teller to serve a student
 14 
 15     public:
 16 
 17         Office(double const office_mean, int const num_tellers) : num_tellers(num_tellers), tellers(vector<int>(num_tellers, IDLE)),
 18                                                                   serve_time(variate_generator< mt19937, exponential_distribution<> >( mt19937(time(0)), exponential_distribution<>( 1 / office_mean))){
 19         }                                                // initialize tellers vector to size num_tellers w/ tellers[i] = IDLE, accumulated times to , and initializes serve_time random variable




 37 int Office::departure_destination(Event* departure) {     // returns the next destination of a student departing from an Office
 38 
 39     if (departure->depart_from == AID) {
 40         return determine_destination(.15, .15, 0, 0, .70);
 41     else if (departure->depart_from == PARKING)
 42         return next_destination = determine_destination(.3, 0, 0, 0, .7);
 43     else if (departure->depart_from == REGISTRAR)
 44         return next_destination = determine_destination(.25, 0, .1, 0, .65);
 45     else if (departure->depart_from == BURSAR)
 46         return next_destination = determine_destination(0, .1, .2, .1, .60);
 47     else
 48         return -1;
 49 }
 50 

then in the header file

 57 int Office::departure_destination(Event* departure);
  • 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-11T01:51:28+00:00Added an answer on June 11, 2026 at 1:51 am

    OK. Follow these rules and you should end up with something pretty close:

    1. Put classes, typedefs, #defines, templates, and inline functions in header files
    2. Wrap your header files with #ifndef/#define/#endif so that accidental multiple inclusions don’t cause mult defined symbols
    3. Put your implementation in your c++ files, and include this headers that have (1).

    The easiest way to understand this is to realize that nothing in a header file generates actual machine instructions or data. Everything in a header is declarative. It describes how something would generate code or data if it were used, for example, to declare a variable. Your C++ files need these “outlines” in order to understand what you want when you try to call some function in another file, invoke a method on an object, etc.

    All of the #define kind of instructions are text processing.

    Template are actually a turing-complete language, but they don’t generate code until you make something with them…and then it is sorta like they are generating their own C++ files.

    Class declarations define what an object would have in it, should you chose to make one.

    So, a typical header file (say my_header) will look like this:

    #ifndef MY_HEADER
    #define MY_HEADER
    
    extern int global;
    
    class A {
       ... data declarations, inline functions ...
       public:
          void f();
    };
    
    #endif
    

    and the C++ file:

    #include "my_header"
    
    int global; // only in ONE C file...this  generates real data
    
    void A::f() { ... generates real code to be linked to ... }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a program that allows multiple users the share screenshots. Every time
I am writing this little python program that will get new posts on the
I have an app that I just got setup with a split view controller
Hello I am trying to make a C# program that downloads files but I
I have a file that describes input data, which is split into several other
I am in the process of writing a spell checker program. basically i split
I have this piece of code that basically checks if one or more files
In my program, we split up a large amount of data that needs to
I'm making a program that takes a three-digit integer and splits it into two
I am writing a program that takes in a CSV file and makes a

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.