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
radouane zili
NA
7
1.5k
how to get a field of an IEnumerator with an index
Sep 2 2016 7:18 AM
Hello,
Is there a way to get a property of an object in an IEnumerator list with an index ?
Normally , if we have this structure :
Person[] peopleArray = new Person[3]
{
new Person("John", "Smith"),
new Person("Jim", "Johnson"),
new Person("Sue", "Rabon"),
};
People peopleList = new People(peopleArray);
the only way to access to the fileds is by using
foreach (Person p in peopleList)
Console.WriteLine(p.firstName+ " " + p.lastName);
}
so my question is :
how can we access to the field with somtthing like this
foreach (Person p in peopleList)
Console.WriteLine(p[0] + " " + p[1]); ???
}
plz to help
Reply
Answers (
3
)
C# windows application Datagridview editing
SelectedValue which is invalid because it does not exist in