我只有一个术语问题。我读过 if、foreach 等是语句,但它在术语中意味着什么 - 这些是命令吗? 这可能是“迷失在翻译中”的问题
最佳答案
In computer programming a statement can be thought of as the smallest standalone element of an imperative programming language. A program is formed by a sequence of one or more statements. A statement will have internal components (e.g., expressions).
Many languages (e.g. C) make a distinction between statements and definitions, with a statement only containing executable code and a definition declaring an identifier. A distinction can also be made between simple and compound statements; the latter may contain statements as components.
简而言之,它是语言中使程序执行一些非常基本的操作的众多指令之一。通过组合语句,您可以定义对您作为作者有意义的复杂事件。您可以通过使用小的构建 block (即这些语句)来定义它。
关于.NET: "foreach"是命令吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3717145/