有这样一个程序: #include using namespace std; long* foo(void) { long a = 1000; return &a; //返回局部对象的值 } int main(void) { long *b = foo(); cout << *b <

 

One Response to 歪打正着—c++栈的行为方式

  1. Shellie says:

    看起来生活很充实,不过深夜4点还不睡有点说不过去哈,这不是以前大学的光景了,岁月总是在一些微笑的变化中飞快流逝.
    如果有一天,我换了个环境,看到中国结,会不会还头晕呢?
    答案是如果不睡觉,第二天上班肯定会头晕 今天是我的生日,来要点祝福哈 一个轮回了..

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>