内存的几个小问题
来源:互联网 发布:周扬青 淘宝 编辑:程序博客网 时间:2024/05/22 01:56
先看问题,下面只我最近刷题发现的几个高频题
char *GetMemory(void){ char p[] = "hello world"; printf("%s\n", p); return p;}void GetMemory1(char *p){ p = (char *)malloc(100);}void GetMemory2(char *&p, int num){ p = (char *)malloc(num);}void Test(void){ char*str = NULL; printf("%x\n", str); str = (char *)malloc(100); printf("%x\n", str); //str = NULL; strcpy(str, "hello"); printf("%x\n", str); free(str); printf("%x\n", str); if (str != NULL) { strcpy(str, "word"); printf("%s\n",str); }}
阅读全文
0 0
- 内存的几个小问题
- 几个小问题的整理
- PING的几个小问题!
- HQL的几个小问题
- jquery的几个小问题
- HQL的几个小问题 .
- 数据结构的几个小问题
- ibatis的几个小问题
- 面试的几个小问题?
- wince的几个内存问题
- 几个关于内存的问题
- Java内存管理的几个小技巧
- 小白请教几个关于Java虚拟机内存分配策略的问题
- 局域网的几个小问题问题
- JSTL,几近晕倒的几个小问题
- WTP1.02相关的几个小问题!
- JS几个小问题的解决
- 关于几个计算机系统的小问题
- Fragment replace的使用
- 【UOJ261 BZOJ 】天天爱跑步(线段树合并)
- leetcode -- 345. Reverse Vowels of a String 【双指针 + 逆序的变形】
- Mybatis:ReflectionException: There is no getter for property named 'productName' in 'class java.lang
- 搜索 棋盘问题
- 内存的几个小问题
- codeforces 821d Okabe and City
- 安装Python3-ipython
- NKOJ 3252 (CQOI 2015) 多项式(数学,高精度)
- 暑期集训之最大公约数问题
- jdbc 工具类的抽取
- 测试用例编写考虑的细节
- 最大公约数等几个算法
- Twitter-Snowflake,64位自增ID算法详解