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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:16:59+00:00 2026-05-27T11:16:59+00:00

I hate to ask for help on such a common error but I’ve been

  • 0

I hate to ask for help on such a common error but I’ve been staring and prodding at my code for two hours trying to find what the compiler says is a missing semi-colon and unspecified type:

error C2146: syntax error : missing ‘;’ before identifier ‘history’…..:
error C4430:
missing type specifier – int assumed. Note: C++ does not support
default-int 1>c:\users\alex\dropbox\lab4\lab4\lab4\customer.h(49):
error C4430: missing type specifier – int assumed. Note: C++ does not
support default-int

#pragma once

#include <string>
using std::string;
#include "customerdata.h"
#include "rentalhistory.h"
#include "item.h"
#include "customer.h"
/*---------------------------------------------------------------------------
Purpose: class Customer contains methods to grab information about a customer, 
such as their id number, address, phone number (stored in class CustomerData). 
It also contains methods that will allow access to information about a 
customer’s rental history (stored in class RentalHistory).

CONSTRUCTION:
(1) empty construction. (2) name and id (3) with information provided by
CustomerData object.
--------------------------------------------------------------------------- */
class Customer
{
public:
    Customer();
    Customer( const Customer & );
    Customer( string, string, int );
    Customer( const CustomerData & );
    ~Customer();

    // get customer's first name.
    string getFirstName() const;

    // get customer's last name.
    string getLastName() const;

    // get customer's id number
    int getIdNum() const;

    // add a movie to customer's rental history
    void addMovie( Item *&, string code );

    // checks to see if it is a valid customer
    bool isValidCustomer();

    // prints the customer's rental history
    void printHistory() const;

    Customer & operator=( Customer &rhs );


private:
    CustomerData data;  // object that contains customer's information
    RentalHistory history; // object that contains customer's rental history
};
  • 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-05-27T11:17:00+00:00Added an answer on May 27, 2026 at 11:17 am

    The error message indicates that the compiler doesn’t recognize RentalHistory as a type. If the type is correctly defined in the included rentalhistory.h, the most common reason for such a problem would be circular dependencies.

    Does rentalhistory.h try to include customer.h? In this case you have circular includes that you need to resolve. In rentalhistory.h you would most likely have to add a forward declaration like class Customer; instead of including customer.h.

    Also: Why does customer.h try to include itself?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I hate ask stupid questions like this, but why doesn't my code do what
I hate to ask such a dumb question, but I'm just starting out, so
So I hate to ask this but the last 10 hours of searching and
I hate to have to ask, but I'm pretty stuck here. I need to
I hate to ask this question on this forum, but I'm having a lot
I hate to ask this, but I'm in a time crunch and I'm hoping
I hate to ask here but I am stumped and so were the guys
Okay I hate to ask this question ... but here goes. I am writing
I hate to ask this here, but many people on stackoverflow have talked about
I hate to ask the same question others have asked in Stackoverflow, but I

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.