TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
mgroesink
NA
19
0
Create multiple instances of a class in a loop
Oct 8 2004 10:49 AM
In C# I create a class and from within a form I want to create multiple instances of that class in a loop. Suppose the name of the class is Emp. I know this doesn't work, but what is the way to fix this? for (int x=0 ; x<10 ; x++) { Emp "Emp" + x.ToString(x) = new Emp() } The problem is that I cannot use a string as above, but how do I give all of the new objects a unique name? And how can I access the newly created objects? Anyone there to help me? Thanks in advance. Marcel Roesink
Reply
Answers (
3
)
Namespaces and compilation (Visual C# 2005 beta related)
anyone knows how to use c# to generate .m file