Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8208263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:16:51+00:00 2026-06-07T09:16:51+00:00

I am very new to programming, and have been following a C++ tutorial for

  • 0

I am very new to programming, and have been following a C++ tutorial for the past week or so. Today, I decided to make my own console application without help to make sure I have all the concept down I have read so far. The application asks you in the beginning for 5 different words to put into a 5 element array. You are then prompted by a menu giving you 4 options: print the contents of the array, re-enter all the words again, edit only one array element, or exit the app.

When I choose the “edit only one array” option, the application gives another menu asking you to press “1” to print the array, or press any other key to just go on editing. The straight-to-editing option leads to a mashed up version of the start of the program, and using the “1” option leads to just chaos: https://i.stack.imgur.com/bFLLz.jpg. The console continues to print objects on the screen similar to the ones in the picture for about 5 seconds, until I am prompted by a popup asking me to end the process. I receive this in the output log after the application closes: pastebin.com/KcRU56Tg

The source code for my application can be found here: http://pastebin.com/vRUddYuK. I would normally attempt to debug this myself (and have been for the past hour and a half), but I feel that this is way over my head. Any help will be appreciated. Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:16:55+00:00Added an answer on June 7, 2026 at 9:16 am

    do { ... } while statements should be avoided when doing iterations. It’s too easy to make logic errors like you did.

    Note that PrintInv is executing it’s cout statement when n == 5, this is an error since inv only has valid elements for indices 0...4.

    Rewrite your iterations with

    for(int i=0;i < 5;++i)
    

    and your logic will be clearer and bugs will be less likely to happen.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm very much new to programming and have been doing fairly well so far.
I am very new to programming, and have been banging my head against the
I am very new to iOS Programming and have been learning for only a
I am very new to C Programming and have a doubt... I've been asked
I'm very new to programming in Android, but have been struggling all day with
Hey I am very new to Web Programming. I have been learning PHP from
I am very new to python programming and have yet to buy a textbook
I'm still very new at programming, and our local SSIS genius isn't here today
I'm very new to iPhone programming, and I'm currently following tutos to understand the
I'm fairly new to Visual Studio (specifically Visual Basic .NET) but have been programming

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.