After entering 8 names,phone numbers,and birthdays. A list appears at the bottom of the console which is suppose to display name,phone number, and birthday. Well with this code the name shows up so does the phone number,but the birthday doesn't show . Can someone help.

Thanks

for(x = 0; x < friend.Length; ++x)
Console.WriteLine
("Name is {0}, phone is {1}, and bday is {2}",
x +1, friend[x].GetName(), friend[x].GetPhone(),
friend[x].GetBday());

hi,

i'm new to C# but i know that arrays starts from 0 ( zero ) not from 1 .. :P
so remove x+1 from your WriteLine function.

Thanks! The problem was code in the main was incorrect

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.