.NET: "foreach"是命令吗?

标签 .net syntax command

我只有一个术语问题。我读过 if、foreach 等是语句,但它在术语中意味着什么 - 这些是命令吗? 这可能是“迷失在翻译中”的问题

最佳答案

来自Statement (programming)

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/

相关文章:

.net - 几个 Visual Studio 项目提示缺少临时文件,因此无法打开。错误代码&H80070003

c# - 获取基本 IQueryable 实例的 Count()

php - Aptana 3 和 PHP 5.4 新的数组格式

mysql - 如何检查 .sql 文件中的 SQL 语法?

.net - NuGet 和 Git 子模块

c# - 如何将 ListBox 绑定(bind)到 XML 文件中的对象列表?

c# - VB.NET 中的“Null-Safe”点符号……或者它是否存在于任何语言中? 'safe dereferencing operator' 或等效使用 LINQ?

C++ 控制台应用程序 MVC

php - 在 php 脚本中执行 curl 命令并从服务器获取响应并提取它

Ruby 在特定目录下运行 shell 命令