I would like to bring up the topic of the ternary operator. For those of you who do not know, in C you can use a?b:c; and have it as a completely valid statement so for example:
Code:
int foo(int bar)
{
return bar>0?1:-1;
}
The above is valid code and will return -1 if bar is negative and 1 otherwise. This is pretty clean code and, assuming you know the operator, is easy to read. Just curious what people think about it since we are talking about making code easier. I know that most of my college professors, though knowing the operator, do not like me using it.