code question

what line of code would i use if i for example have specified what my program does with an "if...blah blah do this" and now i want "if...anything else *error messege*

basically-there are prerequisite inputs, and if anything else is typed in error msg...

does anyone know what i am talking about?

what line of code would that "if anything else" would be?
Last edited on
closed account (j3bk4iN6)
exceptions. try, throw , catch
damn...more advanced stuff i havent yet gone into allright thanks, was hoping it would be as simple as if (anything else) lol...
closed account (j3bk4iN6)
there's
if()
else if()
else if()
else
Last edited on
To be less confusing, you probably want to use

1
2
3
4
5
6
7
8
9
    if (<statement>) {
        <code>;
    }
    else if (<statement>) {
        <code>;
    ...
    else {                              //This is the statement you want, it will be an everything "else"  
        <code>;                         //condition
    }


Last edited on
closed account (j3bk4iN6)
http://www.cplusplus.com/doc/tutorial/operators/
oh thats right....else and if are not the same thing....hah...i still havent even learned that stuff totally well soz for being a newbie
closed account (j3bk4iN6)
I'm sorry I was obscure, I was in a rush.
Topic archived. No new replies allowed.