C++ Online Compiler
Example: Basic Arrow Operator Examples in C++
C
C++
C#
Java
Python
PHP
main.cpp
STDIN
Run
// Basic Arrow Operator Examples #include <iostream> using namespace std; int main() { int number = 10; // Use for output (stream insertion) cout << "Hello, C++!" << endl; // Use for bitwise left shift (multiplication by 2) int shiftedNumber = number << 1; // 10 * 2 = 20 // Use for output again cout << "Original number: " << number << endl; cout << "Shifted number (x2): " << shiftedNumber << endl; return 0; }
Output
Clear
ADVERTISEMENTS