What does the in modifier on a C# method parameter mean?
Correct answer B. The argument is passed by reference but cannot be modified by the method
in passes the argument by reference as read-only. It avoids copying large structs while guaranteeing the method cannot assign to the parameter. The compiler reports an error if the method tries. out is for values the method must assign, ref allows reading and writing, and optional parameters use default values instead. in is mainly a performance tool for large value types.
Answer checked How we write and check questions
Discussion