On Nov 4, 2007 4:39 AM, 崔健 <[EMAIL PROTECTED]> wrote:
> for C :
>   I like use "break" to stop a loop.But ......like this:
>
>   
> for(i=0;i<=5;i++)................................................................loop
>  1
>      {
>       scanf( "%d" , a[i] );
>       if( a[i] == ' ? ' )
>         break;
>      }
>
>   
> for(i=0;i<=5;i++)................................................................loop
>  2
>       scanf( "%d" , b[i]);
>
>   when I enter '?' , it "break" , both the loop 1 and loop 2. But I only want 
> to break loop 1 . The condition is that I can't scan the numbers to b[].

You should run this thorugh a debugger to step through the code to see
what it's really doing. break shouldn't stop the second loop from
running.

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to