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
Ashley Pape
NA
4
522
Why won't my "Delete an entry" section of code work?
Apr 9 2020 11:26 AM
I have tried this:
if (menuChoice == 4)
{
Console.WriteLine("Delete a Movie");
for (i = delete - 1; i < showTitles.Length; i++)
{
showTitles[i] = showTitles[i + 1];
}
Console.WriteLine("New List:");
for (i = 0; i < showTitles.Length; i++)
{ Console.WriteLine("Movies[" + (i + 1) + "]: " + showTitles[i]); showTitles[i] = Console.ReadLine();
} Console.WriteLine();
}
and:
else if (menuChoice == 4)
{
newShowTitles = new string[showTitles.Length - 1];
Console.WriteLine("Delete a Movie");
if (a < showTitles.Length)
{
if (a != (delete - 1))
{
newShowTitles[b] = showTitles[a];
b++;
}
a++;
}
for (int c = 0; c < newShowTitles.Length; c++)
{
showTitles[c] = newShowTitles[c];
}
num--;
}
Neither of these codes are able to do anything... When I get to this section all that comes up on the console is "Delete a Movie" and it goes back to the main menu.... Please help!!
Reply
Answers (
1
)
different zone c# coding problem
Assign custom color to console.background