Customize Consent Preferences

We use cookies to help you navigate efficiently and perform certain functions. You will find detailed information about all cookies under each consent category below.

The cookies that are categorized as "Necessary" are stored on your browser as they are essential for enabling the basic functionalities of the site. ... 

Always Active

Necessary cookies are required to enable the basic features of this site, such as providing secure log-in or adjusting your consent preferences. These cookies do not store any personally identifiable data.

No cookies to display.

Functional cookies help perform certain functionalities like sharing the content of the website on social media platforms, collecting feedback, and other third-party features.

No cookies to display.

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics such as the number of visitors, bounce rate, traffic source, etc.

No cookies to display.

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

No cookies to display.

Advertisement cookies are used to provide visitors with customized advertisements based on the pages you visited previously and to analyze the effectiveness of the ad campaigns.

No cookies to display.

0

近年来,随着较为新式的编程语言的不断涌现,如 C++和 Golang 等,它们的声明变量或函数的方式与传统的编程语言有所不同。这种新式的声明方式通常先写名字再写类型的声明,例如:int num1, int num2。而这样的声明方式容易导致写错,例如:int max(int num1, int num2)。

为了解决这个问题,我们需要注意声明顺序,尤其是在使用新式编程语言时。只有掌握了正确的声明顺序,才能在编程中避免常见的错误。

==

英文翻译:

News Title: The issue of declaration order in programming languages
Keywords: programming languages, declaration order, C++, Golang

News Content:
In recent years, with the emergence of more modern programming languages such as C++ and Golang, their declaration of variables or functions 的方式与传统的 programming languages have changed. This new way of declaration often involves writing the name before the type declaration, for example: int num1, int num2. This can easily lead to errors, such as: int max(int num1, int num2).

To solve this problem, we need to pay attention to the declaration order, especially when using modern programming languages. Only by mastering the correct declaration order can we avoid common errors in programming.

【来源】https://www.zhihu.com/question/551736476

Views: 1

0

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注