Linked Questions

30 votes
3 answers
102k views

Possible Duplicate: getline not asking for input? There is some unique thing happening in my program. Here are some set of commands : cout << "Enter the full name of student: "; // cin ...
Suhail Gupta's user avatar
  • 23.4k
23 votes
7 answers
23k views

Is there a reason why if in my program I am asking the user for input, and I do: int number; string str; int accountNumber; cout << "Enter number:"; cin >> number; cout << "Enter ...
Jon's user avatar
  • 297
-2 votes
2 answers
1k views

When I run this program, and select option 1, it prints both cout statements in void CTree::Add() at once, jumping over the cin.getline(newPerson->name, 20); I had the same piece of code in ...
Zzz's user avatar
  • 3,065
1 vote
2 answers
828 views

Possible Duplicate: Need help with getline() getline not asking for input? I am working on the following code: int main() { int num; string str; cin>>num; int points[num][...
Antrromet's user avatar
  • 15.4k
-1 votes
2 answers
404 views

I have a problem with the getline function in the code below. In the "get" info section I want to be able to store a whole sentence, but I can't make it work. When I open up my program it just skips ...
Steffen Nielsen's user avatar
0 votes
1 answer
232 views

Could you please help me determining what is wrong in my code again? Every time you select a case, for example you selected "1" which is "NBA Player", and you are asked who is your favorite player, ...
Angel Casi Montoya's user avatar
1 vote
1 answer
239 views

cout << "Type in your third message below:\n"; getline(cin, msgth); if (msgth.length() > 0 && msgth.length() < 500) {} else { system("cls"); cout << "Your message ...
Max's user avatar
  • 887
0 votes
2 answers
111 views

int main() { string s1,s2; cout<<"1. "<<endl; cin>>s1; //to accept 1st string cout<<s1<<endl; cout<<"2. "<<endl; ...
HARI's user avatar
  • 1
3 votes
4 answers
26k views

I'm making a C++ Mind Reader program, which is nearly complete. However, it feels the need to skip the second cin. I've searched and I'm not exactly sure what's wrong. I've examined the code and I bet ...
IrshadAM's user avatar
3 votes
5 answers
39k views

Hey, I'm trying to write a program that will accept new tasks from people, add it to a stack, be able to display the task, be able to save that stack to a text file, and then read the text file. The ...
Cistoran's user avatar
  • 1,607
3 votes
6 answers
14k views

I'm studying C++ and I need to create structure Airplane and work with it. My structure Airplane.h #include "stdafx.h" using namespace std; struct Airplane { string destination; int number;...
Heidel's user avatar
  • 3,262
2 votes
2 answers
12k views

This is a very strange problem, when my program asks the user for the address, instead of waiting for input, it seems to skip the getline() function completely Answerinput: cout << "would you ...
superlazyname's user avatar
2 votes
3 answers
8k views

#include<iostream> #include<cstdio> using namespace std; int main() { int T; char J[100], S[100]; int count=0; cin >> T; while(T--) { cin.getline(J,...
behinddwalls's user avatar
1 vote
3 answers
2k views

I am very new to programming and I am trying to write a program in C++ that will convert text inputted by the user into HTML code and output that code onto a text file. I have already written the ...
BCRwar1's user avatar
  • 189
1 vote
3 answers
4k views

I've been working on a shopping cart assignment lately and couldn't understand why would this code below not work. I have to write a code that will output name, cost and quantity of items, for three ...
Bili Xu's user avatar
  • 25

15 30 50 per page