Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does /*!*/ mean in C#?

Tags:

c#

I'm new to C# and am reading code with /*!*/ in what seem like strange places. For instance class methods defined as:

protected override OptionsParser/*!*/ CreateOptionsParser() protected override void ParseHostOptions(string/*!*/[]/*!*/ args) 

Unfortunately /*!*/ is not googleable. What does it mean?

like image 560
Tristan Avatar asked Feb 01 '10 17:02

Tristan


People also ask

What does * mean in C pointers?

A pointer is a variable that stores the memory address of another variable as its value. A pointer variable points to a data type (like int ) of the same type, and is created with the * operator.

What does * mean before a variable in C?

In computer programming, a dereference operator, also known as an indirection operator, operates on a pointer variable. It returns the location value, or l-value in memory pointed to by the variable's value. In the C programming language, the deference operator is denoted with an asterisk (*).

What does a * After a variable in C mean?

Here, * is called dereference operator. This defines a pointer; a variable which stores the address of another variable is called a pointer. Pointers are said to point to the variable whose address they store.


1 Answers

It's likely an attempt to get Spec# style annotations into a non-Spec# build. The ! annotation in Spec# means the value is not-null. The author is likely trying to indicate that both the return values, args array and all of the elements in args are always non-null values.

Spec# Link:

  • http://research.microsoft.com/en-us/projects/specsharp/

Quick Spec# Overview:

Spec# is a .Net language created via a Microsoft Research Project. It is an extension of the C# language which attempts to embed code contracts into the type system. The most prominent are non-nullable types (indicated with ! after the type name), checked exceptions and pre/post conditions.

like image 149
JaredPar Avatar answered Sep 24 '22 08:09

JaredPar