Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: batigolaso
  • Order by date
  1. batigolaso

    String problem?

    jonny b, try this out: #include <iostream> #include <string> using namespace std; void main() { double age; string name; cout << &quot;how old are you?&quot;; cin >> age; cout << &quot;what is your name?&quot;; getline(cin, name); getline(cin, name); //two needed to take in the \n character...
  2. batigolaso

    String problem?

    I ran across the same problem yesterday. Turns out that it's most likely due to putting #include <iostream.h> instead of just #include <iostream> (no .h). Try that and do post your code so I can make sure this is what you're referring to.
  3. batigolaso

    There are always strings tied to strings

    kenji, I was having the same issues. The solution thankfully is quite simple. Change the iostream.h in the inclusion section to iostream :) getline(cin, string) will work after that. However, note: I have problems with this getline statement after importing numbers via cin anywhere else in the...
  4. batigolaso

    There are always strings tied to strings

    lemming, that is pretty good code, but is there any possible way to read the whole line in one go? For example: What is your name? Joe Shmo and then you can assign Joe Shmo to the string. This is easily done in Java, and yet I find it nearly impossible in C++??? How can this be? I'm not even...

Part and Inventory Search

Back
Top