c++ - c语言中普通变量
高洛峰
高洛峰 2017-04-17 13:03:49
0
2
538

c语言中定义的变量在定义时不占用内存,但是赋值时占用内存的情况是怎么样的,和实际赋的那个值在内存中有什么关系吗

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
伊谢尔伦

Memory is allocated when the variable is defined and does not occupy memory when it is declared. A variable occupies a fixed size of memory from the time it is defined until the end of the variable's life cycle. It has nothing to do with whether or what data is saved in it

迷茫

Variables occupy memory when they are defined. The occupied size varies depending on the variable type. Assignment only changes the value stored in the memory block and has nothing to do with the allocated memory address.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template