Why the << and >> for cout and cin?

by Simmons (no login)

 
If I understand correctly, they are both overloaded operators for bitshift.

Why not just cout("Text Here");

For someone like me who relies heavily on a predictable systematic approach to a programming language, stuff like that will throw me for a loop.

Posted on Mar 17, 2017, 9:49 AM

Respond to this message   

Return to Index

Response TitleAuthor and Date
Re: Why the << and >> for cout and cin?Michael Calkins on Mar 17
 Is it because of the wonky string types in C++?Simmons on Mar 17
  Re: Is it because of the wonky string types in C++?Michael Calkins on Mar 17
  Consider this...Anonymous on Mar 19
   `>>` in the shell also redirects but appends instead of overwritingAnonymous on Mar 19
   *So its imitating linux / bash, if I read you correctly?Simmons on Mar 20
    Not so much imitating as drawing inspiration from it.Anonymous on Mar 20
    *DOS/Windows command interpreters also use those symbols for redirection.Michael Calkins on Mar 20
     true, i learned them in dos first, but they must predate dosmn on Mar 20
      *the csh might predate the bourne shell by a year or two-- theyre both late 70smn on Mar 20
      If Wikipedia and its sources are to be believed, redirection operators are *old*!Anonymous on Mar 20
       * Aside: the C shell was innovative...and full of bugs; System V forever? #bsd-must-dieAnonymous on Mar 20
      Dos promptsSimmons on Mar 20
       Re: Dos promptsMichael Calkins on Mar 20
        $P$g is: $path $greaterthanmn on Mar 20
         *I had meant to type $P$G (both capitalized). ughhh...Michael Calkins on Mar 20
          *running freedos in qemu, it does not appear to care which of the two you usemn on Mar 20
          *yeah, it doesnt matter in the docs either.mn on Mar 20
           Butta Bing *Bing on Apr 9
            *What's this about? Removing Mennonite's name from the index?Michael Calkins on Apr 9
             I assumed it was merely a joke at my expenseGill Bates on Apr 9

 Copyright © 1999-2017 Network54. All rights reserved.   Terms of Use   Privacy Statement  

Quantcast