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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:38:49+00:00 2026-06-07T12:38:49+00:00

I am currently switching languages from Java(beginner) to c++ and would like to replicate

  • 0

I am currently switching languages from Java(beginner) to c++ and would like to replicate a BlackJack game I made in Java but am having difficulty with the set up in C++ using codeblocks.

Code Design:

  • enum’s of Rank and Suit.

  • The 52 variations of Rank and Suit are formed together to create 52 objects of Card

  • Store the objects in a vector

  • Randomise Vector

  • Pop two cards from Vector to Player

  • Pop one card to Dealer

  • When the player or dealer is dealt a card, the card retrieved is calculated and value += to int player/dealerValue;

I am lost as to how I can achieve this:

Deck.cpp:

     for(Suit suit: Suit.values()) {
        for (Rank rank : Rank.values()) {   
           add(new Card(rank, suit));   
        }
    }
     createDeck()
     shuffleDeck()
     dealUser()
     dealerDealer()

Player.cpp

     userVector
     dealerVector
     getUserVector()
     getDealerVector()
     addCardUser()
     addCardDealer()
     calcUserValue()
     calcDealerValue()

Card.cpp

     card(Rank rank, Suit suit) { }
     getSuit()
     getRank()

BlackJack.cpp

    call deck constructor
    Player user  =  new Player()
    Player dealer = new Player()

—Game Code—

Could someone please cover or direct me to some good resources for:

  • Managing header files

  • Brief skeleton code blocks for some of the methods I require

  • But most importantly, will I be required to use pointers at all for this program? I’ve only had access to online YouTube tutorials for a few days now while my c++ books arrive and am not yet confident with memory management of any kind.

  • Any general c++ tips for this program would be fantastic.

Many thanks for your time and patience to read this.

  • 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-07T12:38:51+00:00Added an answer on June 7, 2026 at 12:38 pm

    To address your points:

    Managing header files

    Don’t bother. Just throw everything in one source file (you’re perfectly allowed to do this in C++, unlike Java). Maybe sometime later you can break it up into more than one source file, if you want.

    Skeleton code blocks for methods

    If you’ve already got the code written in Java, then there’s your skeleton blocks.

    Do I have to use pointers?

    Probably not. However, if you just want to get started with a program that looks like your Java code, you can always simply ignore manual memory management, call new, and never worry about delete. You’ll have memory leaks all over the place, but one thing at a time, right?

    Typical “modern” C++ style avoids the use of raw pointers almost entirely. You can work on that at some later time.

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

Sidebar

Related Questions

I am currently switching from ant to gradle for my multi module web application
I'm currently in the beginning of a switching process forwards Emacs. However I'm having
I am currently switching from developing two separate Xcode Projects into using Xcode workspace.
Currently I am using dynamic database switching in Cakephp from the database config file.
I'm currently having some problems when switching to flex 4.5. In some components, I
I am currently in the process of switching from Android to the iPhone SDK.
I'm currently working on a Final Fantasy like game, and I'm at the point
I'm currently in the process of switching from Hibernate to pure JPA 2 (which
We're currently using transactions with the Entity Framework, but might be switching to some
I am currently switching from AS3 to JavaScript. I still have some trouble with

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.