+ 1
how do parameters work in methods? c#
i don’t understand why when you call a method, the parameter is different from the one that you put in first. (sorry for my bad English, English is not my first language) thank you!
3 Antworten
+ 7
//our method.
mySum(int i, int j){doSomthing;}
//we call and pass arguments.
mySum(10,20);
//arguments passed to the methods parameters.
mySum(int i holds 10, int j holds 20){doSomthing;}
0
Can you give an example?
0
sure.
like having this method
static int[] TotalizaMediciones(int[] arregloMediciones)
and then calling it like this
int[] totalesRango = TotalizaMediciones(mediciones);
why do i use "mediciones" instead of "arregloMediciones" when i'm calling the method?