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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:04:25+00:00 2026-06-17T23:04:25+00:00

Hey guy I’m wondering if there is a tutorial or example code for a

  • 0

Hey guy I’m wondering if there is a tutorial or example code for a C++ RPG inventory system. I’ve surfed the website and I only discovered to make two classes, item and inventory and to use each of them for item’s detail and holding the items in a linked list.

This is what I have so far..

using namespace std;

int maxWeight;

class inventory {  //manages the entire inventory
public:
    inventory();
    inventory::inventory(int defaultWeight = maxWeight);

private:
    int maxWeight = 100;


};

class item {  //holds the details about a particular item
public:
    item();
    item(char* name, double weight);    
private:
    char* name;
    double weight;
};

I’m hoping my long search for such a tutorial can end..

Thank you.

  • 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-17T23:04:26+00:00Added an answer on June 17, 2026 at 11:04 pm

    Basically, from what I understand so far, what you are looking for is a linked list in your inventory to store all the items. Find out how a linked list works and go ahead from there. You will probably need to

    1. Add items (check the weight of your current linked list prior to adding the item).
    2. Remove items.
    3. Print whatever is in the linked list.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey guy's i'm making a website which involves submiting an ad for a gameserver.
Hey guy's I add made a PHP server status script for my website and
Hey guys I am helping a guy create a website for him. He has
Hey guy i have following problem: I have this line of code which includes
Hey guy's just a quick question. Im making a sortable, drag and drop system
Hey guy's I can't figure out why my code doesn't work when I have
Hey guys this is my html code: <div class=nakupy> <li class=icn_kategorie><a href=#>Nákupy</a> <div class=sub_menu>
Hey folks I am trying to implement a search functionality in a website using
Hey guy's First of all thanks for reading this. I'm having trouble to find
Hey all, just wondering what the best way to add this capability was. 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.