C++ 位元左移/右移運算 x<<y / x>>y March 03, 2008 #include <iostream> using namespace std; int main(){ int n = 10; cout << (n<<3) << endl; // 80 cout << (n>>3) << endl; // 1010 => 1 system("pause"); return 0; } Share Get link Facebook X Pinterest Email Other Apps Labels C++ Share Get link Facebook X Pinterest Email Other Apps Comments
Comments