C语言编程的注意事项

(1)定义结构体的区别

		struct   Student  
    {  
    		int   a;  
    }stu1;//stu1是一个变量  
    
    typedef   struct   Student2  
    {  
    		int   a;  
    }stu2;//stu2是一个结构体类型=struct Student  

对于stu1,可以直接stu1.a调用,而对于stu2则需要stu2 s2,在调用s2.a。

动态空间与静态空间的区别

动态空间:程序运行时产生的空间,手动分配/回收
静态空间:函数编译时确定的空间,自动分配/回收

发布了16 篇原创文章 · 获赞 0 · 访问量 942

猜你喜欢

转载自blog.csdn.net/qq_44157281/article/details/103448806