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 ...
随机推荐
- 蜗牛—Android基础之button监听器
XML文件中有一个textView 和 一个button. <LinearLayout xmlns:android="http://schemas.android.com/apk/re ...
- RSA、AES加密解密
RSA #!/usr/bin/env python # -*- coding:utf-8 -*- import rsa import base64 # ######### 1. 生成公钥私钥 #### ...
- Plug and Play
http://baike.baidu.com/view/33701.htm 即插即用 编辑 PNP是Plug-and-Play(即插即用)的缩写.它的作用是自动配置(低层)计算机中的板卡和其他设备 ...
- ListView优化总结(二)--Android
3.使用Activity和Delegate与适配器交互 这个内容是从书里看到的,通过托付模式帮助开发人员把全部的业务逻辑从适配器中移到Activity中. 以下是加入电话号码的样例,列表中每一行都有一 ...
- shiro框架的使用
1.配置二级缓存 <ehcache updateCheck="false" name="shiroCache"> <defaultCache ...
- 关于CSS和CSS3的布局小知识(干货)
最近在网站偶然看到的这个网站,进去看了下讲的CSS布局,感觉还不错,讲易懂且实用推荐给大家. http://zh.learnlayout.com/
- public,protected,private,static,final的区别(转载)
1.类 (1)在java中有public.protected.private三种显示的修饰符用于控制可见性,package不是显示的修饰符,它是隐含的,即如果在类.变量等前没加显示的可见性修饰符,那它 ...
- 使用 HttpWebRequest 向网站提交数据
HttpWebRequest 是 .net 基类库中的一个类,在命名空间 System.Net 下面,用来使用户通过 HTTP 协议和服务器交互. HttpWebRequest 对 HTTP 协议进行 ...
- 【BZOJ1014】[JSOI2008]火星人prefix Splay+hash
[BZOJ1014][JSOI2008]火星人prefix Description 火星人最近研究了一种操作:求一个字串两个后缀的公共前缀.比方说,有这样一个字符串:madamimadam,我们将这个 ...
- ffmpeg ffplay播放延时大问题:播放延时参数设置
使用ffplay播放视频源时,rtsp/rtmp等,会有一定的延时,这里我们可以通过设置ffplay播放参数将延时控制到最小. ffplay.exe -i rtmp://xxxxxxx -fflags ...