sizeof 几个不被注意的
来源:互联网 发布:网络大专快速本科 编辑:程序博客网 时间:2024/05/22 08:35
#include <iostream>
#include <stdlib.h>
using namespace std;
void Func(char str[100])
{
printf("%d\n", sizeof(str));
}
int main()
{
char str2[200] = {0};
void *p = malloc(100);
Func(str2);
printf("%d\n",sizeof(p));
return 0;
#include <stdlib.h>
using namespace std;
void Func(char str[100])
{
printf("%d\n", sizeof(str));
}
int main()
{
char str2[200] = {0};
void *p = malloc(100);
Func(str2);
printf("%d\n",sizeof(p));
return 0;
}
#include <iostream>
#include <stdlib.h>
using namespace std;
void Func(char *str)
{
printf("%d\n", sizeof(str));
}
int main()
{
char *str2 = NULL;
void *p = malloc(100);
Func(str2);
printf("%d\n",sizeof(p));
return 0;
}
答案是:在32位下都是4字节 ;和大小无关;
0 0
- sizeof 几个不被注意的
- sizeof的注意点
- sizeof的几个实例
- 关于sizeof注意的问题
- 几个注意的问题
- leafletR的几个注意
- sizeof 该注意的一些问题
- sizeof() 的用法以及注意点
- 关于sizeof(特别注意指针的情况)
- 关于sizeof需要注意的地方
- JAVA的几个小注意
- %rowtype的几个注意点
- XHTML的几个注意点
- 几个要注意的TIPS
- %rowtype的几个注意点
- 几个注意的小算法
- spring的几个注意问题
- const注意的几个事项
- memcache常见现象(一)雪崩现象
- 网络编程——第三篇 HTTP应用编程(下)
- The Swift Programming Language--语言指南--闭包
- GIS开源库shapeLib的使用方法
- kvm 的guest与host共享文件
- sizeof 几个不被注意的
- Web前端之复选框选中属性
- hdu1422 重温世界杯 (dp)
- poi从excel中读取父子关系型(树形)数据结构到数据库
- log4j:WARN Please initialize the log4j system properly解决办法
- Qt的setMouseTracking使用
- jion优化原理二
- R student score
- 别说钱不好赚,你忽略掉了多少机会?