Code snippet? For what it's worth, there are practically no subtleties about C/C++ if statements.
Code: Select all
if (condition) {
something-to-do-if-condition-is-true
} else {
something-to-do-if-condition-is-false
}
is a pretty clean structure. Mind you, some people get burned by mixing up '==' and '=' in the the condition expression... reasonable compilers will warn you about that sort of thing (e.g. if using gcc, use -Wall, -ansi and -pedantic to catch a lot of bogosities).