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

Author Topic: c++oop basic  (Read 1792 times)

0 Members and 1 Guest are viewing this topic.

CreaM

  • Newbie
  • *
  • Posts: 36
    • View Profile
c++oop basic
« on: May 22, 2014, 05:30:32 pm »
hello, how can i get data from one class to another, without using specific object?
-smthing like this:
class bank{
public:
        int getMoney(){return money;}
private:
        int money;
}
class thief{
public:void stole(){
                   int money;
                   money = bank.getMoney;
                   std::cout<<"thief stole"<<money;
           }
}
 

please write an example - im beginner

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: c++oop basic
« Reply #1 on: May 22, 2014, 05:32:12 pm »
This has nothing to do with SFML, you'll find better forums for such questions.

Please read a good book about C++, knowing the programming language is mandatory when you want to use libraries like SFML.

Edit: Now I saw we already told you that here. When you don't find it necessary to listen to our advice and read a good book, what do you expect?
« Last Edit: May 22, 2014, 05:40:51 pm by Nexus »
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

G.

  • Hero Member
  • *****
  • Posts: 1592
    • View Profile
Re: c++oop basic
« Reply #2 on: May 22, 2014, 05:46:58 pm »
The SFML C binding forum for a "C++ OOP" question? Nice thinking. ;)

CreaM

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: c++oop basic
« Reply #3 on: May 22, 2014, 06:08:06 pm »
i actually bought c++ book, but it's quite complicated and when i meet a problem i cant solve it using just book - its hard to find simple solution in 400 pages...
ps: i know this isnt much programing message, but...  And sory for the mess in forums.