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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T19:25:47+00:00 2026-06-13T19:25:47+00:00

I can not figure out why this won’t work. When I run it I

  • 0

I can not figure out why this won’t work. When I run it I get all kinds of undeclared identifier errors on my object c1 and customer. If i do a Customer* c1 = new Customer(); I still get the same errors and it will not let me setcustomerID. its probably something stupid, Any input would be awesome.

void checkout(){

    srand(time(NULL));
    int random = rand() % 3 + 1;

    Customer c1;
    c1.setcustomerID("0");
}




class Customer{
public:
    string customerID;
    string list;
public:
    Customer(){}
    ~Customer(){}



    string getcustomerID(){
        return customerID;
    }
    string getList(){
        return list;
    }
    void setcustomerID(string x){
        customerID = x;
    }
    void setList(int x){
        if(x==1)
            list = "bread";
        if(x==2)
            list = "eggs";
        if(x==3)
            list = "cheese";
    }

};
  • 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-13T19:25:48+00:00Added an answer on June 13, 2026 at 7:25 pm

    You should put:

    class Customer{
    

    before your checkout() method

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

Sidebar

Related Questions

I can't for the life of me figure out why this won't work. I
I can't figure out why this program won't work. I'm sure it's something basic.
I can't seem to figure out why this does not work below. I need
I can't figure out why this list is not displaying properly in IE7. The
Not sure why I can't figure this out. When a user makes a selection,
Not sure why I'm getting this error and can't figure it out? The cycle
I'm new to C++ but I can't figure out why this won't compile for
This is really strange and I can't seem to figure out why it won't
Just getting started with Android development and I can't figure out why this won't
I cannot figure out why this doesn't work. It seems so simple. It should

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.