Alright, so I\'m in the process of learning C++, and I\'ve hit a strange effect while working with one of the tutorials, and I don\'t quite get while it\'s happening..
F
In the first case, you are not executing a return statement if the condition isn't met. Presumably the function is returning garbage.
In the second case, because there are no braces, only one line is dependent on the condition. The return statement is executed regardless. In other words, your second example is equivalent to:
char uppercase ()
{
//checks to see if "element"(char) is a lower-case letter between 'a' and 'z'
if ((element >= 'a') && (element <= 'z'))
{
//changes value of "element" to be element + (value of A - Value of a)[-32]
element += 'A' - 'a'; //element = element + -32
}
return element;
};