News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

why?left shift count >= width of type

Started by erwin_diow, June 10, 2011, 11:52:16 AM

Previous topic - Next topic

erwin_diow

when I build the code as following:

#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

MortenMacFly

Quote from: erwin_diow on June 10, 2011, 11:52:16 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]