whan c++ doesnot ignores line | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

whan c++ doesnot ignores line

when c++ doesnot ignores lines ?if it ignores than why?

16th Aug 2020, 1:55 PM
Wajahat Sabir
Wajahat Sabir - avatar
2 Answers
+ 1
Any language ignores lines for two reasons; first line If line is commented then line is not even considered by compiler , second reason is that line is unreachable. Example for first; int main() { /* I am comment ignore me*/ Do_tasks(); } Example for second int main() { while(1) { } I_am_unreachable_task(); }
16th Aug 2020, 2:33 PM
Emre İRİŞ
Emre İRİŞ - avatar
+ 1
Thesmallest while(1) creates endless loop, If somehow conditio n is broken then It becomes reachable
16th Aug 2020, 3:26 PM
Emre İRİŞ
Emre İRİŞ - avatar