Deutsch
Germany.ruФорумы → Архив Досок→ Программирование

Работа тестировщиком после переезда в Германию

18.12.20 16:01
Re: Работа тестировщиком после переезда в Германию
 
AlexNek патриот
AlexNek
Я часто в современном C# коде вижу var.

"Студентов" больше развелось только и всего.

8.5.1 C# spec "When the local-variable-type is specified as var and no type named var is in scope, the declaration is an implicitly typed local variable declaration, whose type is inferred from the type of the associated initializer expression. "

Испоганить можно прогу на любом языке.


This is specified in section 7.8.4 of the C# 4 spec:

For an operation of the form x + y, binary operator overload resolution (§7.3.4) is applied to select a specific operator implementation. The operands are converted to the parameter types of the selected operator, and the type of the result is the return type of the operator.
The predefined addition operators are listed below. For numeric and enumeration types, the predefined addition operators compute the sum of the two operands. When one or both operands are of type string, the predefined addition operators concatenate the string representation of the operands.
 

Перейти на