So in c#, I don't really understand how to call a Method (I think that's what it's called), it's kind of what a function is in JavaScript. Anyway, I was wondering how I call the method outside of the method. I think I call the method like this (without the angle brackets) - (); - If you know how to, please TELL ME!
Do I use 'var' or do I use like int, float, bool, string?
Josiah Turner
You can use both.
Isaac Hughes
Its not working. This looks like JavaScript code.
Eli Adams
Too bad.
Wyatt Cruz
do the needful
Adam Sanders
There are no 'global' methods that you can call just by it's time. If method belongs to some class then you make an object (an instance) of that class and call a method on that object like this poster said: Keep in mind that "var" is the name of the class
Ryan Wright
I don't understand what you me by this?
Josiah Green
>Keep in mind that "var" is the name of the class C# has type deduction.
Jeremiah Gutierrez
If you're asking how to literally call a fucking method, then you should watch or read some introductory tutorial to this language. You can't go straight into writing code without knowing the most basic things.
Bentley Walker
>what are static methods?
Landon Morris
>call a method outside of a method You meant outside of a class? If you meant that you need to make that method static by simply inserting static before the name of the function and you should also make it public so that it's accessible from another class
class firstClass { public static void myFunction() { your code } }
class secondClass { your code... firstClass.myFunction() ; ... }
>>Hi why tf greentext this >So in c#, I don't really understand how to call a Method (I think that's what it's called), it's kind of what a function is in JavaScript. off to a good start >Anyway, I was wondering how I call the method outside of the method. > call the method outside of the method oh lawdy >If you know how to, please TELL ME! CAPS >There are no 'global' methods that you can call just by it's time. >time > If method belongs if english bad >Keep in mind that "var" is the name of the class what the >I don't understand what you me by this? they me something alright >class firstClass >{ >public static void myFunction() >{ your code } >} newfag no comment >Another approach to that is making an instance of that class >... >class secondClass { >static fistClass instance; newfagging continues >WHY ISN'T THIS WORKING ;,,,,( CAPS EMOTICON-UUU >namespace Think_Medieval >{ >class Program >{ >// Variables >(The second time I write playerHealth it has a red underline to it). newfagging continues
I thought the C# devs couldn't be that bad, but damn. Someone post the obligatory handicap pic, looks like it's highly appropriate for this thread or maybe it's the time of day when we get more posters from certain countries