My loop goes infinite

Discussion in 'C Programming' started by bhavinvyas, Jan 9, 2009.

  1. bhavinvyas

    bhavinvyas

    Joined:
    Dec 31, 2008
    Messages:
    1
    Location:
    mumbai
    when i write

    for(;;)
    {

    cin >> input;
    switch(input)
    {

    case 1:
    case 2:
    case 3:
    default:

    }

    }

    when i give integer as input my program works fine
    but when i give char or string input my program goes iautomatic infinite iterations

    why so ?
    whats the solution
     
    bhavinvyas, Jan 9, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Vedran Vukotic

    infinite loop unexpectly dies

    Vedran Vukotic, Mar 2, 2006, in forum: Perl
    Replies:
    0
    Views:
    4,492
    Vedran Vukotic
    Mar 2, 2006
  2. Alexander Bosch

    Infinite loop when using Server.Transfer

    Alexander Bosch, Oct 28, 2004, in forum: ASP .Net
    Replies:
    11
    Views:
    914
    Steven Cheng[MSFT]
    Nov 10, 2004
  3. Allerdyce.John@gmail.com

    loop thru a STL list causes an infinite loop

    Allerdyce.John@gmail.com, Jan 30, 2006, in forum: C++
    Replies:
    5
    Views:
    624
    benben
    Jan 31, 2006
  4. Daniel Berger

    Rake goes into infinite loop on Windows

    Daniel Berger, May 1, 2005, in forum: Ruby
    Replies:
    1
    Views:
    113
    Lionel Thiry
    May 1, 2005
  5. Isaac Won
    Replies:
    9
    Views:
    443
    Ulrich Eckhardt
    Mar 4, 2013
Loading...

Share This Page