Blog

Seleccione el resultado del siguiente código:

class Program {
struct CalCulateStr {
public int Num1, Num2;
public int DoSomething() {
Num1 += Num2; Num2 = Num1 / Num2;
return Num1 + Num2;
}
}

unsafe static Task DoSomething(int wins, int count, CalCulateStr* obj) {
var num = Task.FromResult(obj->DoSomething()).Result;
var CompDesc = Program.fun(“coding with fun, on The .Net JavaScript, SQL, PHP, Python, “, obj->Num1, num);
return CompDesc;
}

public static Task fun(string a, int b,int c) {
var m = a.Replace(‘,’, ‘-‘).Replace(“h”,”hs”) + ” ,” + b.ToString()+” ,”+c.ToString();
return Task.FromResult(m);
}

unsafe static void Main(string[] args) {
CalCulateStr CalStruct = new CalCulateStr();
CalCulateStr* ResultStruct;
ResultStruct = &CalStruct;
ResultStruct->Num1 = 120;
ResultStruct->Num2 = 18;
CalCulateStr* moreStruct= &CalStruct;
var Result = Program.DoSomething(moreStruct->Num1, moreStruct->Num2, moreStruct).Result;
var Final = Task.FromResult(Result).Result;
Console.WriteLine(Final);
}
}