Run-Time Check Failure #3 - The variable 'p' is being used without being initialized.

运行时检查失败 变量p没有初始化就被使用

RTC(Run-Time Check)机制,包括堆栈帧(RTCS)、未初始化变量(RTCu)、两者都有、以及默认值四种。

1.当开启RTCu(对未初始化变量运行时的检查)时,程序会崩溃。提示错误RTC Failure#3:使用了未初始化的变量 
2.当开启RTCs(对堆栈帧运行时的检查)时,可以运行,结果为固定值,针对以上程序,结果为-858993460(%d打印),0xcccccccc(%#x打印)。实际上调用Fun2()开辟新栈帧时,栈帧被0xcc初始化,打印出来的结果如上。 
3.当两者都开启时,与情况一一样,程序崩溃。提示错误RTC Failure#3:使用了未初始化的变量 
4.当使用默认值时,程序可以运行,结果为相对应位置的值。例如本程序中结果为48,若程序Fun1()函数中只有一个变量,值为多少,结果就为多少。说白了,函数Fun2()中变量a的值与其本身无关,而与相对应的内存中存放的值有关。原因是默认值这种模式,当有新的栈帧开辟时,不会有0xcc这个初始化的过程。 
以下为本人对如上问题的理解,如有偏颇,希望同仁批评指正,谢谢!

Run-Time Check Failure #3 - The variable 'p' is being used without being initialized.的更多相关文章

  1. Run-Time Check Failure #2 - Stack around the variable 'ucPriKey' was corrupt

    Run-Time    Check    Failure    #2        一般是栈被破坏,你的代码可能有缓冲区溢出一类的问题. Run-Time Check Failure #2 - Sta ...

  2. VS2008中Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted 错误解决方法

    问题 : 在用VS2008写一段代码,算法都没有问题,但是调试的时候发现出了main之后就报 Stack around the variable 'xxx' was corrupted 的错误,后来发 ...

  3. Run-Time Check Failure #2 Stack around the variable ‘xxx’ was corrupted

    在改别人代码时,运行报错: Run-Time Check Failure #2 Stack around the variable 'buffer' was corrupted 这表明你对某变量的赋值 ...

  4. c++. Run-Time Check Failure #2 - Stack around the variable 'cc' was corrupted.

    Run-Time Check Failure #2 - Stack around the variable 'cc' was corrupted. char cc[1024];   //此处如果索引值 ...

  5. C++程序在debug模式下遇到Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call问题。

    今天遇到一个Access Violation的crash,只看crash call stack没有找到更多的线索,于是在debug模式下又跑了一遍,遇到了如下的一个debug的错误提示框: 这个是什么 ...

  6. Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. 调用函数约定不同

    Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call.  This is ...

  7. Run-Time Check Failure #0

    Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is ...

  8. 图形化界面安装oracle报错Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.

    问题描述: 在Linux + oracle 安装时,采有root 帐号登录x-windows 界面,然后 $su oracle 登录录安装Oracle 报以下错误: >>> Coul ...

  9. Run-Time Check Failure #0,The value of ESP was not properly saved 错误解决

    调用DLL函数,出现错误 Run-Time Check Failure #0 - The value of ESP was not properly saved across a function c ...

随机推荐

  1. https双向认证訪问管理后台,採用USBKEY进行系统訪问的身份鉴别,KEY的证书长度大于128位,使用USBKEY登录

    近期项目需求,须要实现用USBKEY识别用户登录,採用https双向认证訪问管理后台管理界面,期间碰到过一些小问题,写出来给大家參考下. 1:前期准备工作 USBKEY 硬件:我买的是飞天诚信 epa ...

  2. libpcre.so.0 被删除怎么办?

    删除  #rpm -e --nodeps pcre-6.6-1.1 1> wget   http://mirror.centos.org/centos/6/os/i386/Packages/pc ...

  3. HDMI速率计算

    我们在采集HDMI口的数据时,首先肯定要计算它的速率是多少.怎么计算这个速率,本文要跟大家分享的便是这个事情. HDMI口有三个TM-DS(Time Minimized Differential Si ...

  4. kubectl技巧之查看资源列表,资源版本和资源schema配置

    系列目录 在kubernetes里,pod,service,rs,rc,deploy,resource等对象都需要使用yaml文件来创建,很多时候我们都是参照照官方示例或者一些第三方示例来编写yaml ...

  5. PE添加Style

       1. <style id="NumberStyle"> <setting> <param name="option"> ...

  6. Angularv4入门篇1

    国庆时按照官网的tutorial写了遍官方示例,一知半解,不明白angular的服务的服务为何要单独抽离出来.angular应用是如何启用的.近期打算看下angular的文档部分,然后梳理遍以理解an ...

  7. Ubuntu NDK配置与JNI demo

    NDK配置 1.下载最新版本NDK(android-ndk-r9d-linux-x86_64.tar.bz2) 下载网页:http://developer.android.com/tools/sdk/ ...

  8. idea 编辑yml文件没有联想功能,解决方案

    idea 编辑yml文件没有联想功能,解决方案 https://segmentfault.com/q/1010000010556550 按Ctrl+Shift+Alt+S,点Facets如果没有添加s ...

  9. HP叫魔术方法的函数

    PHP5.0后,php面向对象提成更多方法,使得php更加的强大!! 一些在PHP叫魔术方法的函数,在这里介绍一下:其实在一般的应用中,我们都需要用到他们!! 1.__construct() 当实例化 ...

  10. windowbuilder安装

    windowbuilder,也就是原来的SWT Designer.Google收购了Instantiations,把它的工具也重新免费发布了.用过swt designer的人都知它是非常好用的swin ...