Void Function return value with out parameter

Q & AVoid Function return value with out parameter
Admin Staff asked 4 years ago

Void Function return value with out parameter

1 Answers
Admin Staff answered 4 years ago

protected void Page_Load(object sender, EventArgs e)
 {
   // Used as out parameter
   bool test1;
   string test2;
   int test3;
   returnvalefromvoid(“sdsdsd”, out test1, out test2, out test3);
   Response.Write(test1);
   Response.Write(test2);
   Response.Write(test3);
 }

 static void returnvalefromvoid(string value, out bool test1, out string test2, out int test3)
 {
   test1 = false;
   test2 = “test”;
   test3 = 1;
    // Assign value to all out parameters
 }