![]() |
|
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2004
Posts: 5
Rep Power: 0
![]() |
Okay I am learning C++ using the book: Teach Yourself C++ third Edition.
I am trying to write a simple program, that asks the user for some text then, out puts that text as well as the count of characters used. My program is using cin.get() I need to use this so I can see the result of my program and make sure it is working correctly, but I can't seem to get cin.get() working. here is the code: /* A C++ program that uses I/O to prompt user for a striong and then display its length */ #include <iostream> #include <string> // library that allows the use of cin.get(); (stops the program) I think using namespace std; int main() { char i; double d; cout << "Please enter some text."; cin >> i; cout << i; cin.get(); return 0; } |
|
|
|
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|