Is “else if” a single keyword?

后端 未结 8 1973
忘了有多久
忘了有多久 2021-01-31 01:13

I am new to C++. I often see conditional statement like below:

if 
  statement_0;
else if
  statement_1;

Question:

Syntacticall

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-31 01:35

    else and if are two different C++ keywords. An if statement can be followed by an optional else if...else statement. An if statement can have zero or more else if's and they must come before the else.

    You can find syntax and example in this if...else statement tutorial

提交回复
热议问题