typeof() test demo
来源:互联网 发布:什么软件可以泡妞 编辑:程序博客网 时间:2024/06/03 20:44
typeof(x) y;
把y定义成x的数据类型;
其参数 x有2款类型;
1 表达式
// func为int类型, 即var为int类型变量
extern int fun();
typeof(fun()) var;
2 参数
typeof(int)
typeof(int *)
typeof(int *[4])
typeof(typeof(int *)[4])
typeof(*x) y;
typeof(*x) y[4]; //y是*x的数据类型, 该数据类型组成的数组;
#include <stdio.h>#include <unistd.h>int fun(){}int main(int argc, char *argv[]){//declare int a;typeof(int) a;//declare int *b;typeof(int *) b;//declare int *c[3];typeof(typeof(int*)[3]) c;typeof(b) d;//declare expression;typeof(fun()) var; a = 3; b = &a; c[0] = b; var = 4; d = &var; printf("a %d, b %p, c[0] %d %p var %d d %d\n", a, b, *c[0], c[0], var, *d); return 0;}/*$ g++ typeofDemo.cpp -o td$ ./td.exea 3, b 0x22cc64, c[0] 3 0x22cc64 var 4 d 4*/
0 0
- typeof() test demo
- a20 uart0 test demo
- PV操作--demo test
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof
- typeof()
- typeof()
- typeof
- typeof
- 利用Mono.Cecil动态修改程序集来破解商业组件
- MVC框架介绍
- 南邮 OJ 1469 求和
- 【OC06】类目、延展、协议、计时器(连载八)
- NSArray和NSMutableArray
- typeof() test demo
- ADB not responding. If you'd like to retry, then please manually kill “adb.exe” and click 'Restart'
- 南邮 OJ 1484 烧饼重叠问题
- C#开发winform中OpenFileDialog的运用还可以多选
- hdu 5344 (多校联赛) MZL's xor --- 位运算
- UI04_Touch
- 南邮 OJ 1492 Nasty Hacks
- java ClassLoader 详解
- UI_UILTView