Created
August 9, 2011 20:13
-
-
Save jparishy/1135073 to your computer and use it in GitHub Desktop.
Const order test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main(int argc, char** argv) | |
{ | |
const int const1 = 1; | |
const int const2 = 2; | |
const int const3 = 3; | |
int blah = 4; | |
int foo = 5; | |
int bar = 6; | |
if((blah == const1) && (foo == const2 || bar = const3)) | |
{ | |
std::cout << "Test\n"; | |
} | |
return 0; | |
} | |
// Compiling with (gcc -v): gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) | |
// Macintosh:Desktop jparishy$ gcc constantordertest.cpp | |
// constantordertest.cpp: In function ‘int main(int, char**)’: | |
// constantordertest.cpp:14: error: lvalue required as left operand of assignment |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment