1

Can somebody explain them to me and mainly help me understand >> and <<. I just started to study C++ and it's being used constantly in console input/output applications.

Thanks.

MasterMastic
  • 20,711
  • 12
  • 68
  • 90
  • Can you post an example which depicts their usage? – cpx Oct 31 '11 at 08:05
  • @cpx `cout << "Hello World!";` `int a; cin >> a;` – MasterMastic Oct 31 '11 at 11:07
  • 1
    Those are definitely not bitwise operators, however you might want to see this [question](http://stackoverflow.com/questions/141525/absolute-beginners-guide-to-bit-shifting) too. – cpx Oct 31 '11 at 11:18

2 Answers2

3

These are not bitwise operators you are seeing there, rather the stream extraction and insertion operators.

http://cplusplus.com/reference/iostream/ostream/operator%3C%3C/

http://www.cplusplus.com/reference/iostream/istream/operator%3E%3E/

FailedDev
  • 26,680
  • 9
  • 53
  • 73
2

Those are stream operators - if you're using them for input/output. Bitwise operators are completely different.

Check out this link: http://www.java2s.com/Code/Cpp/Overload/Overloadstreamoperator.htm

Luchian Grigore
  • 253,575
  • 64
  • 457
  • 625