网站首页  英汉词典

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

 

单词 Forward declaration
释义

Forward declaration

中文百科

前向声明

在进程设计中,前向声明Forward Declaration)是指声明标识符(表示编程的实体,如数据类型、变量、函数)时还没有给出完整的定义。

一个简单的C/C++例子:

在C++中, 上行代码是一个函数的前向声明,也是该函数的原型。编译器处理该行源码后,允许进程员在随后的进程中引用函数print; 不过进程员必须在某处提供这个被声明的函数的定义:

在Pascal与其它Wirth型的编程语言中, 一般规则是所有实体必须在使用前被声明. C语言适用同样的规则, 但存在未声明的函数与不完备的数据类型这样的特例. 因此,C语言允许(虽然不够明智)实现一对相互递归函数:

英语百科

Forward declaration 前向声明

In computer programming, a forward declaration is a declaration of an identifier (denoting an entity such as a type, a variable, a constant, or a function) for which the programmer has not yet given a complete definition.

It is required for a compiler to know certain properties of an identifier (size for memory allocation, data type for type checking, such as type signature of functions), but not other details, like the particular value it holds (in case of variables or constants) or definition (in the case of functions). This is particularly useful for one-pass compilers and separate compilation.

随便看

 

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

 

Copyright © 2004-2024 encnc.com All Rights Reserved
更新时间:2025/6/18 16:34:57