سؤال

How can I set the size of an array via an InputBox(referenced from VisualBasic) in c#?

هل كانت مفيدة؟

المحلول

Do you mean something like this one ?

 var size = Interaction.InputBox("Enter the array size:");
 int arraySize;
 if (int.TryParse(size, out arraySize))
 {
      var myArray = new int[arraySize];
 }
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top