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
Prashant Jadhav
NA
38
14.2k
indexer
Aug 3 2014 9:55 AM
hey guys i was creating indexer and i had some issue i didnt got any compile or runtime error but there was no out put
here is that coding tell me where i made wrong coding.
using System;
namespace ConsoleApplication13
{
class employee
{
public string name;
public string branch;
public int ID;
}
class employees
{
employee[] empl=new employee[3];
public employee this[int x]
{
get
{
switch(x)
{
case 0: empl[0] = new employee();
return empl[0];
case 1: empl[1] = new employee();
return empl[1];
case 2: empl[2] = new employee();
return empl[2];
}
return null;
}
}
}
class Program
{
static void Main(string[] args)
{
employees e=new employees();
e[0].name="prashant";
string a=e[0].name;
Console.WriteLine("{0}",a);
Console.ReadLine();
}
}
}
Reply
Answers (
1
)
list collection working
C# 2010 work with ssrs report