tag:blogger.com,1999:blog-6497434045878013201.post1480506420437313627..comments2023-12-06T18:45:51.800-08:00Comments on Dot Net Tips & Tricks , C# (C Sharp)Tips & Tricks: Bad array declarator: To declare a managed array the rank specifier precedes the variable's identifier. To declare a fixed size buffer field, use theUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-6497434045878013201.post-80055861898109619762013-04-24T03:21:35.861-07:002013-04-24T03:21:35.861-07:00[WebMethod]
public Tool[] getToolList(str... [WebMethod]<br /> public Tool[] getToolList(string s)<br /> {<br /><br /> Tool[] a = new Tool[2];<br /><br /> Tool a[0]=new Tool();<br />// the above throws an error. WHY? <br /><br /> a[0].ToolID = "1";<br /> a[0].Description = "TOOL1";<br /><br /> a[1].ToolID = "2";<br /> a[1].Description = "TOOL2";<br /><br /> // Console.WriteLine(a[0]);<br /><br /> return a;<br /> }<br /><br /> public class Tool<br /> {<br /> public string ToolID;<br /> public string Description;<br /> }Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-6497434045878013201.post-76494231178818794192011-01-09T00:53:08.807-08:002011-01-09T00:53:08.807-08:00//Why is this in error?
string[,] cmdArr = new st...//Why is this in error?<br /><br />string[,] cmdArr = new string[2,3] {<br /> {"quit | exit", "Ends the program."},<br /> {"list", "Prints out the current text list."},<br /> {"help", "Prints the list of possible commands."}<br /> };Mathhead200http://mathhead200.comnoreply@blogger.comtag:blogger.com,1999:blog-6497434045878013201.post-1835116798451621472010-03-18T00:56:26.262-07:002010-03-18T00:56:26.262-07:00Thanks for your post, at school we program in java...Thanks for your post, at school we program in java und at work I program in c#, so I always get confused with declaring arrays ;)Anonymousnoreply@blogger.com