Jump to content
Welcome, Guest
Existing user? Sign In

Sign In



Sign Up
The MatriX
  • Welcome To Ghbsys
  • CS GO Streaming Version is released. Have fun streaming while cheating!
  • Have a Payment Issue? Send us a Support ticket.
  • Make a thread if you need support or join our discord for live support.
  • Have Suggestions? Make a thread and you'll earn Ghbsys Points for implemented suggestions.
  • Join our discord to stay well connected! Don't forget to integrate your discord to the site
  • Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum

    Welcome to [GHB] - GAmEhAcKbAsTaRdS Forum, like most online communities you must register to view or post in our community, but don't worry this is a simple free process that requires minimal information for you to signup. Be apart of [GHB] - GAmEhAcKbAsTaRdS Forum by signing in or creating an account.
    • Start new topics and reply to others
    • Subscribe to topics and forums to get email updates
    • Get your own profile page and make new friends
    • Send personal messages to other members.

    Objekt Orientiertes "Hello World" xD


    xxka1saxx
     Share

    Recommended Posts

    #include <cstdlib>
    #include <iostream>
    #include <string>
    using namespace std;
    class cOOP {
    			public:
    				   string hello, world;
    
    			void oop();
    			};
    int main(int argc, char *argv[])
    {
    cOOP hw;
    
    hw.hello = "Hello";
    hw.world = "World";
    
    hw.oop();
    
    system("PAUSE");
    return EXIT_SUCCESS;
    }
    void cOOP::oop() { 
    		  cout << hello <<" "<< world << endl;
    		  }

     

    Ausgegeben wird :

    "Hello World"

    U will see "Hello World" if u run it.

    Wer den Code nich versteht soll fragen...

    Ask if u don´t understand the code...

    Link to comment
    Share on other sites

    • 2 weeks later...

    #include <iostream>

    #include <string>

    using namespace std;

    class World_class {

    private:

    string hello, world;

    public:

    void set_string(string tmp1, string tmp2){hello = tmp1;

    world = tmp2;}

    void get_string(){cout << hello <<" "<< world << endl;}

    };

    int main(int argc, char *argv[])

    {

    World_class hw;

     

    hw.set_string("hello","world");

     

    hw.get_string();

     

    system("PAUSE");

    return EXIT_SUCCESS;

    }

     

    more nice i think =D

    Link to comment
    Share on other sites

    Guest
    This topic is now closed to further replies.
     Share

    • Recently Browsing   0 members

      • No registered users viewing this page.
    ×
    ×
    • Create New...