What version of C# am I using?

血红的双手。 提交于 2019-12-24 15:13:40

问题


How do I tell what version of C# I'm using? I'm using a Mac with xCode. The reason I ask is because i have a book " C# 3.0" and it says that you can declare an multidimensional array like this.

int[,] num = new int[2,2];

When I try to do this I get a syntax error. Do I need to import another header other than foundation?


回答1:


Have you tried changing

new int[2.2]

to

new int[2,2]

?




回答2:


I think Walt's answer is right, but here's a good resource for determining which version of C# you're using with your .NET install (thanks to Jon Skeet's "C# In Depth" book!):

http://csharpindepth.com/Articles/Chapter1/Versions.aspx




回答3:


Are you sure that you are programming in C# and not Objective C? Importing foundation is something you would do in Objective C, not C#.



来源:https://stackoverflow.com/questions/1331715/what-version-of-c-sharp-am-i-using

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!