Author Topic: why?left shift count >= width of type  (Read 8126 times)

Offline erwin_diow

  • Single posting newcomer
  • *
  • Posts: 2
    • C++ Embedded System Developers
why?left shift count >= width of type
« on: June 10, 2011, 11:52:16 am »
when I build the code as following:
Code
#include <iostream>

using namespace std;

int main()
{
    cout << "请输入一个大于1的整数:" << endl;
    int x;
    cin>>x;
    if(x>1 || x<<99)
        cout<<"x大于1或小于100\n";
    else
        cout<<"x大于或者等于100\n";
    return 0;
}
there is a warning
Welcome everyone! I want to make Code::Blocks as well known as vc++ in China.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: why?left shift count >= width of type
« Reply #1 on: June 10, 2011, 12:16:34 pm »
there is a warning
Unrelated to Code::Blocks. Please respect our forum rules and ask in a C/C++ developer forum. Thank you.

Topic locked.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ