What i have to write before? * = Console.ReadLine(); * | SoloLearn: Learn to code for FREE!

+3

What i have to write before? * = Console.ReadLine(); *

Fill in the blanks to ask for user input in the method and return the value entered using output parameters. static void Ask( out string name) { = Console.ReadLine(); } static void Main(string[] args) { string nm; Ask( out nm); }

2/26/2018 6:31:03 PM

Zahid Farook

1 Answer

New Answer

0

static void Ask(out string name) { name = Console.ReadLine(); } You don't return anything. The out parameter acts similar to a pointer, meaning that if you modify an out variable in your method, the change will persist since you modified the out variable you overloaded directly.