C++ sizeof
来源:互联网 发布:思快奇软件下载 编辑:程序博客网 时间:2024/06/05 00:59
#include <iostream>using namespace std;void f(char str[]) { cout << sizeof(str)<<endl;}// error C2084: 函数“void f(char [])”已有主体void f(char str[100]) { cout << sizeof(str) << endl;}int main(){ char str[] = "http://www.bilibili.com/"; char* p = str; int n = 10; cout << sizeof(str)<<endl; cout << sizeof(p) << endl; cout << sizeof(n) << endl; char s[100]; cout << sizeof(s) << endl; f(str); f(s); void *tp = malloc(100); cout << sizeof(tp) << endl; return 0;}
x86输出:
25
4
4
100
4
4
4
x64输出:
25
8
4
100
8
8
8
阅读全文
0 0
- sizeof.c
- C SIZEOF
- c++-sizeof
- c sizeof
- 【C++】sizeof
- C sizeof
- c sizeof
- 【C/C++】:sizeof详解
- 【C/C++】浅谈sizeof
- C语言中的sizeof
- C++:深入理解sizeof
- C语言中的sizeof
- sizeof C 语言
- c关键字-[sizeof]
- C语言:sizeof
- C/C++ sizeof 总结
- C语言--sizeof
- C语言函数sizeof
- port
- js基础-this关键字 ★★★
- ORA-19602: cannot backup or copy active file in NOARCHIVELOG mode
- Linux core 文件介绍
- OpenCV non-free functionality (SURF) not built in 解决方法
- C++ sizeof
- windows 临界区的实现原理
- java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApplicationContext.setId
- 【C++】C++运算符重载的规则
- 【MySQL基础】MySQL安装第三弹-mariadb-10.2.8
- Mac 命令行出问题
- Java与C++的区别
- particles.js中文开发手册
- caffe:Check failed: status == CUDNN_STATUS_SUCCESS (3 vs. 0) CUDNN_STATUS_BAD_PARAM