Skip to content

Instantly share code, notes, and snippets.

@jparishy
Created August 9, 2011 20:13
Show Gist options
  • Save jparishy/1135073 to your computer and use it in GitHub Desktop.
Save jparishy/1135073 to your computer and use it in GitHub Desktop.
Const order test
#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