Use of null statement in C

前端 未结 12 1942
挽巷
挽巷 2020-11-29 09:12

What are typical uses of null statement

;

in C ?

I know that it is basically used to skip expression where it is expected

12条回答
  •  暗喜
    暗喜 (楼主)
    2020-11-29 09:53

    It's more of a null expression rather than a null statement, but it's often found in for loops.

    for (;;)                 // Loop "forever"
    
    for (int i=10; i--; )    // 9..0
    

    etc

提交回复
热议问题