![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C语言
小菜一枚
这个作者很懒,什么都没留下…
展开
-
char str[] = "hello world";和char *str = "hello world";区别
http://www.cnblogs.com/zhengyuhong/archive/2011/12/23/2299241.htmlchar str[] = "hello world";和char *str = "hello world";区别char *strA(){ char str[] = "hello world"; return str;}转载 2012-09-18 21:34:59 · 3801 阅读 · 0 评论 -
数组与字符串、字符指针与其他类型指针、赋值参数、指针参数以及引用参数、函数指针
原文地址:http://www.cppblog.com/xingjiegaojue/archive/2009/08/12/93099.aspx数组与字符串、字符指针与其他类型指针、赋值参数、指针参数以及引用参数、函数指针◆数组和字符串从表面上看,一个字符串就是一个字符数组,但在C++语句中,两者并不完全相同。字符串是一个以串尾符"\0"结尾的字符型数组,但任一个字符型数组不转载 2012-09-19 16:08:45 · 1117 阅读 · 0 评论 -
union总结
#include union{ int i; unsigned char ch[2]; }student; int main() { student.i=0x1420; printf("%d %d",student.ch[0],student.ch[1]); return 0;原创 2012-11-05 23:30:57 · 825 阅读 · 0 评论 -
char str[] = "hello world";和char *str = "hello world";区别
char *strA(){ char str[] = "hello world"; return str;}str[] = "hello world"//"hello world"常量字符串在内存中有两份拷贝,一份在动态分配的栈中,一份在静态存储区,str[]数组为函数内部局部变量,存储在栈上,在strA()函数退出时,栈要清空,局部变量的内存也被清空char *s原创 2012-11-15 15:56:01 · 3318 阅读 · 1 评论