Skip to content

Example seems incorrect. #25422

Open
@qsdfplkj

Description

@qsdfplkj

This example makes no sense to me without the in keyword it is also still 44. The in keyword seems only usefull to state that the argument cannot be changed within the scope of the method.

        int readonlyArgument = 44;
        InArgExample(readonlyArgument);
        Console.WriteLine(readonlyArgument);     // value is still 44

    private static void InArgExample(in int number)
    {
        // Uncomment the following line to see error CS8331
       // number = 19;
    }

[Enter feedback here]


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 448841

Metadata

Metadata

Labels

📌 seQUESTeredIdentifies that an issue has been imported into Quest.in-prThis issue will be closed (fixed) by an active pull request.okr-qualityContent-quality KR: Concerns article defects (bugs), freshness, or build warnings.

Type

No type

Projects

Status

🏗 In progress

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions