takmicenjesutra's blog

By takmicenjesutra, 10 years ago, In English

Take a look at the following code:

#include <cstdio>
#include <set>

using namespace std;

set<int> s;

int main()
{
    printf("%d", s.size() > -1);
    return 0;
}

Output is 0, but it should be 1 (obviously s.size() = 0 > -1). Code is tested on ideone and codeforces compilers. Can somebody explain this?

Full text and comments »

  • Vote: I like it
  • -12
  • Vote: I do not like it