I'm not too familiar with programming in C (I've only done a few small projects in the language), however, my professor said something about it's behavior today that left me a bit confused.
What he said was that this code will sometimes not print anything at all (I copied down exactly what was on the board, I believe this is pseudocode for C since "print" is not in C):
int a = ___________;
int b = ___________;
if (a < b)
print (“<“);
if (a > b)
print (“>”);
if (a==b)
print(“=”);
Basically, there is something you could store in those int variables where none of these conditions would be met (the ____ isn't actual code obviously, it just represents that something is there). It doesn't necessarily need to be some int number that fills those blanks...it could be anything in the world (and there can be stuff that happened before this code).
What is it that could fill those blanks and wouldn't produce any result, and why?
p.s - it had something to do with an overflow, undefined behavior, out of bounds error, or something of the like
p.p.s - I have serious trouble believing this professor was mistaken. He is more knowledgable about programming than anyone I've ever come into contact with. I'm convinced there is some case where this is true.