why there is semicolon after loop while();

后端 未结 4 517
天命终不由人
天命终不由人 2020-12-18 10:54

I am reading a code of my friend an I see this:

#include 
#include 

void main()
{
    char string1[125], string2 [10];
    in         


        
4条回答
  •  北荒
    北荒 (楼主)
    2020-12-18 11:08

    Semicolon is like empty instruction. If we don't put any instruction after while or use loop while with {} we must use semicolon to tell compiler that all we want from while loop is doing this empty instruction.

提交回复
热议问题