C#: Nonzero-based arrays are not CLS-compliant

后端 未结 4 1789
青春惊慌失措
青春惊慌失措 2021-01-02 06:24

I am currently reading Albahari\'s C# 3.0 in a Nutshell and on pg. 241, whilst talking about Array indexing, he says this:

Nonzero-based arr

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-02 07:26

    Also,

    If your application is not intended to work with other programs - as in it is a self-contained unit that you won't sell as a public class library to other people, do not worry about it too much.

    But the other comments here are correct when developing a generic class library.

    It is always good practice to use [assembly:CLSCompliant(true)], but it isn't critical to getting your application running.

提交回复
热议问题