I think Code::Blocks is broken... its not recognizing the logical OR operator:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
#include <windows.h>
using namespace std;
int main()
{
string test;
cin >> test;
if (test != "test" || test != "hi")
{
cout << "this is a test";
}
else {cout << "hi";}
return 0;
}
|
even when I type hi, it still says this is a test
EDIT:
Now I KNOW it is broken, it is not letting me use bitwise operations:
1 2
|
int a;
cout << ~a << endl;
|
It says "
cannot open output file bin\Debug\testproj.exe Permission denied" Help?
Last edited on
You don't have permissions on it, try opening it as an administrator.
the error is you probably already have the executable open somewhere else. Anyways..I think you meant to use &&
otherwise it will always be true.
test = "test"
test != "test" == 0
test != "hi" == 1
0 || 1 == 1
test = "hi"
test != "test" == 1
test != "hi" == 0
1 || 0 == 1
test = "a"
test != "test" == 1
test != "hi" == 1
1 || 1 == 1
Last edited on