程序中变量分布的区域总结 堆 栈 字符常量区 全局数据区 静态存储区
来源:互联网 发布:final java关键字 编辑:程序博客网 时间:2024/06/06 03:52
程序中变量分布的区域总结 堆 栈 字符常量区 全局数据区 静态存储区
#include "stdafx.h"#include <stdio.h>#include <memory>//Var:variable变量 g_:global全局 staticRegion静态区 constantRegion常量区 int g_Var=6;// global initialized; 6/g_Var in constantRegionchar *g_pVar; // global uninitialized; g_pVar in constantRegionint main(int argc, char* argv[]){int s_Var=5; // s_Var in stack; 5 in constantRegionchar *s_pVar; // s_pVar in stack;char s_arr[]="abcde";// abcde in constantRegion; s_arr in stack 字符串变量数组 char *s_arrxx="xxxxx";// xxxxx in constantRegion; s_arrxx in stack 字符串常亮static int s_c=61;// 9/c in globalStaticRegion;g_pVar=(char*)malloc(10);// g_pVar in constantRegion; allot 10 byte in heap;s_pVar=(char*)malloc(20);// s_pVar in stack ; allot 20 byte in heap;strcpy(g_pVar,"qwer");return 0;}
0 0
- 程序中变量分布的区域总结 堆 栈 字符常量区 全局数据区 静态存储区
- 程序在内存中存储情况:栈,堆,代码区,全局(静态)区 ,常量区
- C++内存分布——堆、栈、自由存储区、全局/静态存储区和常量存储区
- 【程序5大区】堆、栈、自由存储区、全局/静态存储区、常量存储区
- 常量 栈 自由存储区 堆 全局/静态存储区
- C++中堆和栈的区别,自由存储区、全局/静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局/静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局/静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C++中堆和栈的区别,自由存储区、全局静态存储区和常量存储区
- C的栈、堆、自由存储区(C++)、全局/静态存储区、常量存储区
- 堆、栈、程序区、静态数据区、字符常量区的介绍与区别
- C/C++中,内存中数据存储分成4个区:堆、栈、全局/静态存储区和常量存储区。
- 反渗透设备:反渗透设备工艺流程及用途具体阐述
- SQL Server日期时间函数
- 安装包压缩的追根溯源
- tomcat性能优化及其jvm内存分析
- canvas下雪效果
- 程序中变量分布的区域总结 堆 栈 字符常量区 全局数据区 静态存储区
- 反渗透设备:反渗透设备主要特点及应用情况概述
- Quartz 2D编程指南(三)路径 path
- HDU 5151 Sit sit sit(区间DP)
- spin_lock & mutex_lock的区别
- Java注释@interface的用法
- cocos2d-x (音效音乐)SimpleAudioEngine
- UVALIVE 3971<最大化最小值>
- TCP Loop Connect