网站首页  英汉词典

请输入您要查询的英文单词:

 

单词 typedef
释义

typedef

英汉-汉英词典
n. 定义类型
词组 | 习惯用语
您要查找的是不是:
  • typed vt. 打字(type的过去式和过去分词)
  • adaptive adj. 适应的,适合的
typedef n. 定义类型

网络短语:
typedef KeyType 整型
typedef int 整型
typedef float 浮点型
typedef bool 布尔
typedef f 数据类型说明; 重新进行数据类型定义;
typedef double 双精度型
typedef union 颜色分量交换结构
typedef long 长整型
sizeof typedef 其他关键字
中文百科

Typedef

zh:zh|typedef 在C和C++编程语言中,typedef是一个关键字。它用来对一个数据类型取一个新名字。目的是为了使源代码更易于阅读和理解。

来看以下代码:

现在来看以下代码:

这两段代码都做同样的一件事。第二个例子使用了 typedef,使其更易于了解将要进行什么。也就是一个变量包含关于苹果的信息,而另一个包含关于橘子的信息。

再来一个例子:

此处用户定义一个数据类型 var

像这样创建一个 var 类型的变量,代码必须写为(注意,在 C++ 中宣告一个 struct 时,同时也隐含了 typedef,C 则没有):

英语百科

typedef

typedef is a reserved keyword in the C and C++ programming languages. It is used to create an alias name for any other data type. As such, it is often used to simplify the syntax of declaring complex data structures consisting of struct and union types, but is just as common in providing specific descriptive type names for integer data types of varying lengths. They are most often used when a standard declaration is cumbersome, potentially confusing, or likely to vary from one implementation to another.

随便看

 

英汉网英语在线翻译词典收录了3779314条英语词汇在线翻译词条,基本涵盖了全部常用英语词汇的中英文双语翻译及用法,是英语学习的有利工具。

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/19 18:10:35