I'm attempting to construct an array of user defined information. For the life of me, I cannot figure out how to place the user's input into the array or how to disallow more than 5 values to be placed into the array?
kahaj
0
Junior Poster
Recommended Answers
Jump to PostI would use a List<> instead of an array, because you can create a List<> and then add new elements to it.
string[] someArray = new[] { "Alpha", "Bacta", "Cata", "Dooku", "Ephem" }; List<string> xs = new List<string>(); foreach (string s in someArray) { if (xs.Length < …
Jump to PostSet as last statement in your Main method something like Console.ReadKey(); otherwise your Console window will vanish into oblivion...
Might be a typo but in Main you are calling SetUpTheArrays in your class this method is defined as SetUptheArrays.
Find your coding style a bit weird, but fine with me …
All 6 Replies
Rashakil Fol
978
Super Senior Demiposter
Team Colleague
kahaj
0
Junior Poster
DdoubleD
315
Posting Shark
ddanbe
2,724
Professional Procrastinator
Featured Poster
sknake
commented:
lol
+17
DdoubleD
315
Posting Shark
DdoubleD
315
Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.