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 6909315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:40:26+00:00 2026-05-27T08:40:26+00:00

OK I have a simple app that generates 2 integers and asks the user

  • 0

OK I have a simple app that generates 2 integers and asks the user to sum them and enter the result as input. I am checking that the input is an integer. If it’s not I want to rewrite the whole line instead of just outputing the same line. For example:

prompt:

2 + 2 = 

user enters this and presses ENTER:

2 + 2 = s

I want to have this in the terminal:

2 + 2 = 

instead of this:

2 + 2 = s
2 + 2 =

I understand that C++ is very abstract and has no notion of a terminal or where the output goes. I’m using linux. Any way I can do the above?

  • 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-05-27T08:40:27+00:00Added an answer on May 27, 2026 at 8:40 am

    You should be able to do this directly in most terminals by printing out the right control characters. For example, if you print a carriage return instead of a new line the cursor may be taken back to the beginning of the line to write over what’s been printed on that line.

    However this is dependent on how your terminal deals with these characters, and so you might want a library that provides a standard interface for these terminal specific features, like ncurses.

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

Sidebar

Related Questions

I have a very simple iPhone app that requires a random integer from 1-100.
I have a simple little email app that allows a user to pick certain
This is a real newbie question. I have simple app that selects a picture
I have a simple app that uses an SQL Express 2005 database. When the
Right so I have a simple app that consists of a calendar a Set
I'm now testing GKPeerPickerController. I have a simple app that just have a button
I have a simple iphone app that's based on the CrashLanding sample app. So
I have a simple PHP app that prints 'hello world'. When I run it
I have a simple GAE app that includes a login/logout link. This app is
Let's say I have a fairly simple app that lets users store information on

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.