变量范围 [英] scope of variables

查看:173
本文介绍了变量范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么局部变量在C使用堆叠/ C ++?

Why do local variables use Stack in C/C++?

推荐答案

从技术上讲,C不使用堆栈。如果你看一下 C99标准,你会发现没有参考到堆栈。这可能是C ++标准一样,虽然我还没有检查它。

Technically, C does not use a stack. If you look at the C99 standard, you'll find no reference to the stack. It's probably the same for the C++ standard, although I haven't checked it.

栈是被大多数编译器实现C自动存储语义只是实现细节。

Stacks are just implementation details used by most compilers to implement the C automatic storage semantics.

这篇关于变量范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆