Thread: urgent help needed!!!

  1. #1
    Registered User
    Join Date
    Dec 2007
    Posts
    15

    Unhappy urgent help needed!!!

    Hey everyone!
    I'm trying to pull this next code and for some reason, a reason i can't understand, the bold line marked in red is being ignored by the compiler. It just skips it and continue to the next line:
    Code:
    string word, trans, use;
    int index;
    
    cin >> choose;
    switch (choose)
    {
      case (1):
      {
        cout << "Please enter word: " << endl;;
        getline (cin, word, '\n'); 
        cout << "Please enter translation: " << endl;
        getline (cin, trans, '\n'); 
        cout << "Please enter a use of the word in a sentence: " << endl;
        getline (cin, use, '\n'); 
        cout << "Please choose commonness scale: " << endl;
        cin >> index;
        newData = new Data (word, trans, use, index);
        list.insert (*newData);
        break;
      }
    in the end of the function both "trans" and "use" are initialized while "word" is not.
    help anyone...

  2. #2
    Registered User
    Join Date
    Sep 2007
    Location
    Arizona
    Posts
    164
    You have a double ;; at the end of the first line!

  3. #3
    Registered User
    Join Date
    Dec 2007
    Posts
    15
    I more than agree but unfortunately that doesn't seem to solve the problem...

  4. #4
    The larch
    Join Date
    May 2006
    Posts
    3,573
    The exact same problem was last dealt with here (see my last post).

    It should also be in a FAQ because it is a very common pitfall.
    I might be wrong.

    Thank you, anon. You sure know how to recognize different types of trees from quite a long way away.
    Quoted more than 1000 times (I hope).

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    15
    Thanks!!!

  6. #6
    Registered User mikeman118's Avatar
    Join Date
    Aug 2007
    Posts
    183
    Quote Originally Posted by anon View Post
    The exact same problem was last dealt with here (see my last post).

    It should also be in a FAQ because it is a very common pitfall.
    Actually, it kind of already is: http://faq.cprogramming.com/cgi-bin/...&id=1043284392

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Urgent Help Needed In Writing Algorithm!!
    By Vikramnb in forum C++ Programming
    Replies: 1
    Last Post: 01-09-2009, 12:46 PM
  2. Urgent! Help Needed
    By DarkManiac in forum C++ Programming
    Replies: 4
    Last Post: 04-14-2004, 07:16 PM
  3. unknown error, urgent help needed
    By chris285 in forum C++ Programming
    Replies: 5
    Last Post: 04-30-2003, 04:09 AM
  4. Help Needed: Borland C++ 5.5 Installation - URGENT!
    By Linette in forum C++ Programming
    Replies: 12
    Last Post: 03-09-2002, 06:44 PM