In the same line of the output character string

 

/ * Use the sample carriage return \ r: the rewrite line * / 

#include <time.h> 
#include <stdio.h> / * --- wait x ms --- * / int SLEEP (unsigned Long x) 
{ 
    of clock_t C1 = Clock (), C2; do {
         IF ((C2 = Clock ()) == (of clock_t) - . 1 )     / * error * / return 0 ; 
    } the while ( 1000.0 * (C2 - C1) / CLOCKS_PER_SEC < X);
     return . 1 ; 
} int main ( void 
{




    
              

 )
    printf("My name is BohYoh.");
    fflush(stdout);

    sleep(2000);
    printf("\rHow do you do?    ");
    fflush(stdout);

    sleep(2000);
    printf("\rThanks.           ");

    return 0;
}

 

Guess you like

Origin www.cnblogs.com/sea-stream/p/11037597.html