Thread: You send me the code please! Show me how. objects in another class

  1. #1
    Registered User
    Join Date
    Feb 2015
    Posts
    74

    You send me the code please! Show me how. objects in another class

    You send me the code please! Show me how.
    I want about just that - objects in another class.
    I have simply do not know how to begin, tell us what my having trouble with.
    You show good freaks from C ++ of providing a learning path.
    This like the Tower of Hanoi, but the question properties of classes in C ++.
    What in objects of class create objects of other class?
    I really do not understand how to do it.
    Give me a good example or a link to another similar code.
    PLEASE HELP
    Code:
    class golky
    {
    protected: 
     
      static int count ( const int  peredavats = 0)
        {
            static int  counter = 0; 
      
            return  counter += peredavats;
        }
      int n;  // Ціле число
      
      dysk:n;  // диск повинен мати якесь число - номер диска. 
      
      
      
      gla *  pgla = new gla dysk[n];  //  Голка має на собі диски, які мають номери 
      
      
      
        
    public:
    
     golky(int nn): nn(n) // інициализуючий конструктор
        { 
       for (int i=0; i<n; i++){
          pgla[i].dysk(i+1);
                                 }
        }  //  На голці або є диски або їх нема. За умовою все на одному диску спочатку.
                   
     ~golky() // руйнівник   потім допишу
        { delete []dysk; pgla =NULL; }  
    
        
      dysksnjaty (n){}; 
      
      dyskpoklasty (n){}; 
      
     void vsepokajemo(){} // покажемо що-небудь 
      
    }
      
      
      
    class dysk
    { 
    protected: 
      int n;  // Ціле число
         
    public:
    
      dysk(int nn) // инициализуючий конструктор
        { n=nn; }
    
     ~dysk() // руйнівник
        {  }  
     
     void dysk(int nn)   //  Ми можемо якщо треба привласнити диску число. Диск має число.
        {  n=nn;  }  
      
      }
    Хотілося реалізувати таке завдання. It would be desirable to implement such a task.
    У грі міститься декілька "golky"
    The game contains to several "golky"

    Кожна "golky" на неї може вдягтися "dysk". Each "golky" it can be worn "dysk".
    Кожен "dysk" має свій номер. Each "dysk" has a its own number.
    Наприклад один, два, три, чотири. For example, one, two, three, four.

    Під час гри "dysk" можна класти на "golky", кожен з них по порядку. During the game "dysk" can lay down on the "golky", each one on order.
    "Dysk" можна знімати та одягати методами класу. "dysk" can be removed and worn methods of the class.

    Якщо ж "dysk" що має старшого номера виявиться зверху над "dysk" що має молодшого номера тоді потрібно детектувати помилку.
    If "dysk" having senior numbers would be on top of the "dysk" having a minor number then it is necessary to detect an error.

    http://images.vfl.ru/ii/1435002982/08e4e79f/9099248.bmp


    ??????????????

    C ++ allows you to create any type of data from any of the properties.
    So i wanted to create objects golky and dysk.
    It turns out my skill C ++ very bad.

    Yes - it's very interesting!
    I would not even something that only Hanoi. No, I'd better C ++.
    For example an array of objects belonging to the same class for use in another class.
    I would like all sorts of feints, and frills in C ++, greatly improving my skills.
    It excites me to learn what I do not know ..

    !!!!!!

    You can show the code how that would be an object of class dysk it can be removed from one object class golky and add it to the other object class golky?
    Ви можете показати код так що б об'єкт класу dysk можна було видалити з одного об'єкту класу golky-в та додати його ж до іншого об'єкту того ж класу golky-в?

    Ви розумієте?
    Do you understand?

  2. #2
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,738
    Please, stop using google translate( or whatever auto-translator you're using ), and actually learn how to communicate in written english. Sorry but nobody is going to take you seriously if you don't.
    Devoted my life to programming...

  3. #3
    Registered User
    Join Date
    Oct 2006
    Posts
    3,445
    Quote Originally Posted by GReaper View Post
    Please, stop using google translate( or whatever auto-translator you're using ), and actually learn how to communicate in written english. Sorry but nobody is going to take you seriously if you don't.
    That seems a little harsh. Yes, this is an English-speaking forum, but you could be a little more kind to people who clearly don't speak the language.

    Очень жаль, что мы не так много пользователей, которые говорят по-русски. Вы вряд ли получите необходимую вам помощь здесь. Я предлагаю мои извинения за то, как вел себя Greaper, и я надеюсь, что вы не позволите это больно ваше мнение других членов на этом форуме. Я желаю вам удачи в поиске ответов на ваши вопросы.
    What can this strange device be?
    When I touch it, it gives forth a sound
    It's got wires that vibrate and give music
    What can this thing be that I found?

  4. #4
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Quote Originally Posted by Elkvis View Post
    Очень жаль, что мы не так много пользователей, которые говорят по-русски. Вы вряд ли получите необходимую вам помощь здесь. Я предлагаю мои извинения за то, как вел себя Greaper, и я надеюсь, что вы не позволите это больно ваше мнение других членов на этом форуме. Я желаю вам удачи в поиске ответов на ваши вопросы.
    1. You better not use google translate as well - better leave it in English so person can translate it by himself - more chance to understand the result seeing both variants. I'm native Russian speaker have problem understanding the result.

    2. He is not Russian - but Ukrainian which is close but not the same language.

    3. His Russian has same problems as English - I hardly understand it.
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

  5. #5
    Registered User rogster001's Avatar
    Join Date
    Aug 2006
    Location
    Liverpool UK
    Posts
    1,472
    You send me the code please!
    This, and most of the rest of the post comes across as demanding and rude - and cynically I am inclined to believe that even were the OP to have complete command of English then the 'do my work for me' message would not change very much.

    However, i'm giving benefit of the doubt, and perhaps there are other Ukraninan or Russian boards that would serve the member better?. Salesforce - the cloud CRM offering - employs loads of Russian programmers - in Moscow, so there must be some discussion boards, given that US companies are outsourcing there.
    Last edited by rogster001; 06-27-2015 at 05:29 AM.
    Thought for the day:
    "Are you sure your sanity chip is fully screwed in sir?" (Kryten)
    FLTK: "The most fun you can have with your clothes on."

    Stroustrup:
    "If I had thought of it and had some marketing sense every computer and just about any gadget would have had a little 'C++ Inside' sticker on it'"

  6. #6
    Registered User
    Join Date
    Feb 2015
    Posts
    74
    Thank you all !! I later read everything carefully.
    I am a very long time to read English. In addition, I pop in a machine translator, too, of course.
    Otherwise, I much just do not understand.

    I certainly apologize if suddenly.
    By the way, I prefer to Ukrainian, but I also completely free Russian.

    Yes, it is terrible. I've translated the English back

    I ask for help friend.
    My friend knows English.

  7. #7
    Registered User
    Join Date
    Feb 2015
    Posts
    74
    Я іноді перекладав двома перекладачами, і намагався добитися схожого, майже днакового результату.
    Якщо бачив не те, я трохи змінював текст. Вийшла така ж .. нісенітниця.
    Пізніше я напишу краще, напевно.
    I sometimes two interpreters translated, and tried to achieve similar, almost identical results.
    If the saw is not what I'm slightly changed text. The result was the same .. nonsense.
    Later I'll write better, probably.

  8. #8
    Registered User
    Join Date
    Feb 2015
    Posts
    74
    So can someone cause compiled code sample? Namely, as objects of the same class, stored in the object of another class, as well as those objects move (transfer) inside of another class?
    I hope I'm not too bent? It is even possible?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 01-06-2015, 09:04 AM
  2. Replies: 3
    Last Post: 07-15-2010, 07:53 PM
  3. Deleting objects show no drop in memory usage.
    By theJ89 in forum C++ Programming
    Replies: 8
    Last Post: 04-02-2006, 06:21 AM
  4. Replies: 4
    Last Post: 10-16-2003, 11:26 AM
  5. base class pointer to derived class objects
    By curlious in forum C++ Programming
    Replies: 4
    Last Post: 09-28-2003, 08:39 PM