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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:39:31+00:00 2026-06-14T21:39:31+00:00

In a swicth there are a case: case 3: cout << Digite la palabra

  • 0

In a swicth there are a case:

case 3:
    cout << "Digite la palabra que desea añadir: ";
    cin >> word;
    cout << "Digite el significado de la palabra: ";
    getline(cin,auxstr);
    result = addWord(word,auxstr);

but when I compile & run the program it’s as if I pressed enter to getline without allow me enter a line:

Digite la opción adecuada: 3
Digite la palabra que desea añadir: a
Digite el significado de la palabra: La palabra a ha sido añadida con éxito en el diccionario

“La palabra a ha sido añadida con éxito en el diccionario” is the output of addWord function.

  • 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-14T21:39:33+00:00Added an answer on June 14, 2026 at 9:39 pm

    You still have the '\n' from the previous line in the buffer, so when getline tries to get the input from the buffer, it only takes the '\n' and assumes the job is done, not allowing you to input anything else.

    Just put cin.get() before getline(cin,auxstr);

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

Sidebar

Related Questions

Is there a CTRL+space -like way of auto-constructing a switch case around a given
Is their any cases in C++ Like these case WM_COMMAND: switch(LOWORD(wParam)) That happen when
is there any way to switch the user (to root or so) while deploying
Is there a way to use a switch statement to set the value of
Is there a simple command line switch or a trick to renaming the generated
When there is a process switch, and the page tables and page directory of
My problem is there is a switch in my app which toggles for 12
I want to know if there's a shortcut/hotkey to switch between XAML to the
Possible Duplicate: C# - Is there a better alternative than this to ‘switch on
Look at this code please: char o,t; cin >> o >> t; switch (o,t)

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.