What Does "cin" And "cout" Mean?

homerxhomerx Join Date: 2003-04-01 Member: 15094Members
edited April 2004 in Off-Topic
And it's definition.

Thanks in advance. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->

Comments

  • SteeleSteele Join Date: 2004-04-11 Member: 27858Members
    edited April 2004
    cin means c input , you need a variable to take the input. Here is an example

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    int homerx;
    cin >> homerx;
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
    The variable stores the input for later use. And in the console window there will be those blinky lines waiting for user input.

    cout mean c out, this basically puts text on the console. Example:

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    cout << "Homerx" << endl;
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    This puts homerx on the console window. or you can do it with a variable.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1-->
    char homerx = "S";
    cout << homerx << endl;
    <!--c2--></td></tr></table><div class='postcolor'><!--ec2-->

    Hope this helps, here are some great links for tutorials

    <a href='http://www.cprogramming.com' target='_blank'>Tutorial page 1</a>
    <a href='http://www.cpp-home.com' target='_blank'>Tutorial page 2</a>
  • BlackMageBlackMage [citation needed] Join Date: 2003-06-18 Member: 17474Members, Constellation
    actually cin and cout input and output to the default input/output devices
    (usually the console) but they can be set to in/out to/from other places
  • OttoDestructOttoDestruct Join Date: 2002-11-08 Member: 7790Members
    This makes more sense when you get into classes (make your own string class, or something similar) and you start overloading the insertion and extraction operators.
  • QuaunautQuaunaut The longest seven days in history... Join Date: 2003-03-21 Member: 14759Members, Constellation, Reinforced - Shadow
    Wow. This actually helped me in my incredibly slow learning of C++. Thank you first poster guy, and those afterward!
  • NarfwakNarfwak Join Date: 2002-11-02 Member: 5258Members, Super Administrators, Forum Admins, NS1 Playtester, Playtest Lead, Forum Moderators, Constellation, NS2 Playtester, Squad Five Blue, Reinforced - Supporter, Reinforced - Silver, Reinforced - Gold, Reinforced - Diamond, Reinforced - Shadow, Subnautica PT Lead, NS2 Community Developer
    Java is much less arcane when it comes to input/output stuff, but then again, it's Java, so you can't actually use it for much of anything. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo-->
  • BlackMageBlackMage [citation needed] Join Date: 2003-06-18 Member: 17474Members, Constellation
    <!--QuoteBegin-Narfwak+Apr 18 2004, 12:59 PM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (Narfwak @ Apr 18 2004, 12:59 PM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> Java is much less arcane when it comes to input/output stuff, but then again, it's Java, so you can't actually use it for much of anything. <!--emo&:D--><img src='http://www.unknownworlds.com/forums/html//emoticons/biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /><!--endemo--> <!--QuoteEnd--> </td></tr></table><div class='postcolor'> <!--QuoteEEnd-->
    java is annoying
  • HawkeyeHawkeye Join Date: 2002-10-31 Member: 1855Members
    I once knew C++ and Java in and out. Now I only know C now, and I'm trying to remember how classes work. *scratches head and clicks on tutorial links*
  • UltimaGeckoUltimaGecko hates endnotes Join Date: 2003-05-14 Member: 16320Members
    Doesn't the c stand for condition or something?

    <-- knows that they do, but doesn't have a compiler, or taken a class in 3 years.
  • TrojanTrojan Join Date: 2002-11-02 Member: 4611Members
    The c stands for command or console, depending on your OS (win or *nix respectivily) iirc
  • SkulkBaitSkulkBait Join Date: 2003-02-11 Member: 13423Members
    edited April 2004
    <!--QuoteBegin-OttoDestruct+Apr 18 2004, 10:54 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>QUOTE</b> (OttoDestruct @ Apr 18 2004, 10:54 AM)</td></tr><tr><td id='QUOTE'><!--QuoteEBegin--> This makes more sense when you get into classes (make your own string class, or something similar) and you start overloading the insertion and extraction operators. <!--QuoteEnd--></td></tr></table><div class='postcolor'><!--QuoteEEnd-->
    Bah! Those are shift operators! std::string just uses them for stream I/O.
Sign In or Register to comment.