typedif int mytype[10]的作用
2013-07-01 00:00
169 查看
typedif int mytype[10]的作用
typedefint *p;
标识符p将被定义为了一个typedef name,这个typedefname表示一个类型,什么类型呢?就是int *p这个声明中标识符p的类型(int*)。
typedefdouble MYDOUBLE;
分析:去掉typedef ,得到正常变量声明=>double MYDOUBLE;变量MYDOUBLE的类型为double;
MYDOUBLE d; <=> d是一个double类型的变量
typedefint* Func(int);
分析:去掉typedef ,得到正常变量声明=> int* Func(int);
变量Func的类型为一个函数标识符,该函数返回值类型为int*,参数类型为int;
Func *fptr; <=> fptr是一个pointer to function with one int parameter,returning a pointer to int
Func f; 这样的声明意义就不大了。
typedefint (*PFunc)(int);
分析:去掉typedef ,得到正常变量声明=> int (*PFunc)(int);
变量PFunc的类型为一个函数指针,指向的返回值类型为int,参数类型为int的函数原型;
typedef int A[5];
分析:去掉typedef ,得到正常变量声明=> int A[5];
变量A的类型为一个含有5个元素的整型数组;
typedefint *p;
标识符p将被定义为了一个typedef name,这个typedefname表示一个类型,什么类型呢?就是int *p这个声明中标识符p的类型(int*)。
typedefdouble MYDOUBLE;
分析:去掉typedef ,得到正常变量声明=>double MYDOUBLE;变量MYDOUBLE的类型为double;
MYDOUBLE d; <=> d是一个double类型的变量
typedefint* Func(int);
分析:去掉typedef ,得到正常变量声明=> int* Func(int);
变量Func的类型为一个函数标识符,该函数返回值类型为int*,参数类型为int;
Func *fptr; <=> fptr是一个pointer to function with one int parameter,returning a pointer to int
Func f; 这样的声明意义就不大了。
typedefint (*PFunc)(int);
分析:去掉typedef ,得到正常变量声明=> int (*PFunc)(int);
变量PFunc的类型为一个函数指针,指向的返回值类型为int,参数类型为int的函数原型;
typedef int A[5];
分析:去掉typedef ,得到正常变量声明=> int A[5];
变量A的类型为一个含有5个元素的整型数组;
相关文章推荐
- Hibernate的cascade属性 特别是 cascadeType.all的 作用
- vector<int>::size_type 解释
- GetWindowTextW(LPTSTR,int) const' :cannot convert parameter 1 from 'char[10]
- LinkageError之loader (instance of xxx) previously initiated loading for a different type with name "lib/MyData"
- The method add(int, Fragment) in the type FragmentTransaction is not applica
- 码农小汪-Hibernate学习10-hibernate继承映射 @DiscriminatorColumn DiscriminatorType @Inheritance InheritanceType
- Mysql中,int(10)和int(11)的区别
- Mysql中,int(10)和int(11)的区别
- The operator == is undefined for the argument type(s) int, null
- Python ValueError: invalid literal for int() with base 10 实用解决方法
- Mybatis中的jdbcType的作用
- c++ const int 和int 有什么区别,const的作用是什么。【by徐玉丽】
- The hierarchy of the type MyMessageInbound is inconsistent
- 数据结构2:int a; int* a; int** a; int (*a)[10];int *a[10]; int (*a)(int)区别
- TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
- response.setContentType()的作用及参数
- ValueError: invalid literal for int() with base 10: ' ' 文本转化为向量错误解决
- error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
- enctype="multipart/form-data"的作用和影响
- My 10 favorite links on Software architecture, scalability and design