Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED]Need some help with structs or classes.  (Read 1367 times)

0 Members and 1 Guest are viewing this topic.

Santa-Claus

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
[SOLVED]Need some help with structs or classes.
« on: April 05, 2014, 02:42:13 pm »
Hello everyone,

So i have a question how would i be able to do something like the following in C++ (using structs or classes) (Code example is visual basic)
Code: [Select]
Private Type BankRec
    Item(1 To MAX_BANK) As PlayerInvRec
End Type
I'm pretty new to C++ and used to use visual basic..... but in visual basic you don't have all the same possibilities and especially not in VB6.0

Kind Regards,
Santa-Claus,
« Last Edit: April 05, 2014, 04:08:48 pm by Santa-Claus »

eike

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: Need some help with structs or classes.
« Reply #1 on: April 05, 2014, 03:20:08 pm »
I don't know VB, but have a look at "enum". How do you think about a C++ book?  ;)


Santa-Claus

  • Newbie
  • *
  • Posts: 11
    • View Profile
    • Email
Re: Need some help with structs or classes.
« Reply #2 on: April 05, 2014, 03:26:56 pm »
And i am actually reading a book atm :p
Just don't find how to do this
I'm actually not looking for enums :(
That's more for item rarity or tile attributes or anything like that.

I think i'm gonna use classes :)

Code: [Select]
class Inventory {
public:
Inventory();
struct slot
{
int ItemNumber;
int Amount;
};
private:
int Max_Slots;
};

€dit: found it.

King Regards,
Santa-Claus,
« Last Edit: April 05, 2014, 04:07:55 pm by Santa-Claus »

 

anything