Run-Time Check Failure #3 - The variable 'p' is being used without being initialized.
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.的更多相关文章
- Run-Time Check Failure #2 - Stack around the variable 'ucPriKey' was corrupt
Run-Time Check Failure #2 一般是栈被破坏,你的代码可能有缓冲区溢出一类的问题. Run-Time Check Failure #2 - Sta ...
- VS2008中Run-Time Check Failure #2 - Stack around the variable 'xxx' was corrupted 错误解决方法
问题 : 在用VS2008写一段代码,算法都没有问题,但是调试的时候发现出了main之后就报 Stack around the variable 'xxx' was corrupted 的错误,后来发 ...
- Run-Time Check Failure #2 Stack around the variable ‘xxx’ was corrupted
在改别人代码时,运行报错: Run-Time Check Failure #2 Stack around the variable 'buffer' was corrupted 这表明你对某变量的赋值 ...
- 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]; //此处如果索引值 ...
- 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的错误提示框: 这个是什么 ...
- 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 ...
- Run-Time Check Failure #0
Run-Time Check Failure #0 - The value of ESP was not properly saved across a function call. This is ...
- 图形化界面安装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 ...
- 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 ...
随机推荐
- c和c++的输入输出
格式输出: printf(格式控制, 输出表列); %d 十进制数 %md m为指定的宽度 若数据位数小于m,则左端补以空格;若大于m,则按实际位数输出 %ld 长整型数据 %mld 指定字段宽 ...
- 算法NB三人组
#快速排序-除了python自带的sort排序模块之外就这个最好用,只需会这个就行,其他的排序了解就好,能用冒泡,插入..的都可以用快排快速实现 import random from timewrap ...
- PHP date()获取系统时间不对
使用date_default_timezone_set(”)方法; <?php error_reporting(0); date_default_timezone_set('PRC'); hea ...
- disabled和readonly
项目中,有一个input控件,input的值需要通过点击一个javascript链接,从弹出的对话框中所列出的项中选择.而不能从input框中直接输入. 刚开始将input的disabled属性设置为 ...
- JS/PHP字符串截取
<script> var str="首都医科大学附属北京同仁医院-156"; var index = str.indexOf('-');//获取-的索引值,从0开始算, ...
- js 怎么传递参数
<!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat=&qu ...
- mysql 5.6 bug
https://dev.mysql.com/doc/refman/5.6/en/account-management-sql.html USE mysql; SELECT Host,User FROM ...
- the algebra of modulo-2 sums disk failure recovery
x=y x_+_y=0 The bit in any position is the modulo-2 sum of all the bits in the corresponding positio ...
- Jsp中操作页面显示
通常我们想改变网页中的显示可以用下面的方式. <script type="text/javascript">function show(){ document. ...
- 初识代码封装工具SWIG(回调Python函数)
这不是我最早使用swig了,之前在写Kynetix的时候就使用了swig为python封装了C语言写的扩展模块.但是当时我对C++还不是很了解,对其中的一些概念也只是拿来直接用,没有理解到底是什么,为 ...