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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:37:24+00:00 2026-06-11T14:37:24+00:00

Hello I am working on a C++ program and I am just starting out

  • 0

Hello I am working on a C++ program and I am just starting out by creating some sample objects out of the class that I created. I am creating the object but for some reason the dot operator is not working with the object

This is the object call

Card testcard(Suit hearts, Value six);

This is the constructor

Card::Card(Suit suit, Value facevalue)
{
Card::suit=suit;
Card::faceValue=facevalue;
};

However the dot operator is not working, as if the object is not really there

I am controlling most of the program in seperate parts so there are many instances of header files which is where the card class is located, I am not sure if that is part of the problem

  • 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-11T14:37:25+00:00Added an answer on June 11, 2026 at 2:37 pm

    Assuming the class looks something like:

    class Card {
    public:
        Card (Suit argSuit, Value argFaceValue);
    
    private:
        Suit   m_Suit;
        Value  m_FaceValue;
    };
    

    The constructor would look like this. Since the members of the class are available to the objects created from the class you do not need to do anything special to access them. The members of the class are within scope and are visible. You just need to make sure that the argument list of the function uses different symbols or names than the class/object members.

    Card::Card(Suit argSuit, Value argFaceValue)
    {
        m_Suit = argSuit;
        m_FaceValue = argFaceValue;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I'm working on a problem that requires me to change an set array
Hello everyone i am working on a project which requires me to export some
Hello all I am working in javascript and html5.I want to ask that how
Hello I have this list that i am working on. When i move the
hello its really weird that a if and else statement is not working in
I am trying to get a sample program working with JUNG , a graphing
I just installed Ubuntu and tried making the famed Hello World program to make
There is a slight part of my program that is not working correctly and
I am looking for the prototypical 'Hello World' program that creates a Mathematica Notebook
note: this is in C++ but using C-style strings hello SO, I'm working on

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.