Quote (Steamie @ Aug 3 2015 06:26am)
How do I complile a code..? Like run it?
in visual studio, there should be an option to "Build". i think it's under the "Project" menu, but i could be wrong.
Quote
Also I defined the _name of sodacrate.add_soda in the public class soda, I would like to think. Cause if _type is defined then _name should be defined because the both are exactly the same.
you need to specify the parameters in your method call since you defined your function as requiring those parameters.
Quote
public void add_soda(string _name, int _cost, string _type)
Quote
And didnt I define pos with
Code
string pos2 = Console.ReadLine();
int.TryParse(pos2, out pos);
Like the user enters a int value and the int value is pos2, then after TryParse out comes pos. So pos should be pos2 after it checked if its a number.
No. the TryParse method accepts the first param and returns a value in the second param. you still need to define the variable. you defined pos2 but not pos.
Quote
"Extension method must be defined in a non-generic static class" - I have no idea what this means. I followed "help code" as it's called. I was given a task and in the task explaining what to do it provided code.
i suggest being careful about using provided code you don't understand.
This post was edited by carteblanche on Aug 3 2015 07:36am