C++ 分号的使用

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_25244495/article/details/83177265

别人的帖子:https://blog.csdn.net/cainiaowys/article/details/7098122

不是偷懒,是因为类型定义后面可以顺便定义变量。 
struct A {} x, y, z; 与 struct A {}; x, y, z; 是不同的东西。

int;bool;或是struct{};class{};

struct Point { 
   int x; 
   int y; 
} p1, p2; 
 

只有函数和if、while等语句块的{}后面可以不用分号

猜你喜欢

转载自blog.csdn.net/qq_25244495/article/details/83177265