The best way to initialize multiple Objects of the one Class in C# -


i have app people can enter details console, details stored object, problem don't know how many needed initialization needs happen dynamically. have decided use list right thing use? if not pointers in right direction great.

list fine, assuming object called "inputdata" following

public list<inputdata> inputlist = new list<inputdata>();  public void builder() {        string input = console.readline();    inputdata id = new inputdata(input);    inputlist.add(id); } 

then can iterate through data @ later point foreach

foreach(inputdata in inputlist) {     i.dosomething; } 

not sure if wanting do, let me know fi have more specific query


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -