[LCP]Another Simple C question
    James Mclean 
    james at adam.com.au
       
    Thu Jul  4 17:42:05 UTC 2002
    
    
  
OK, along the same lines as before, how would i do the same thing, but
this time with multiple lines?
Here is the code i have been trying to do it with.
#include <stdio.h>
#include <unistd.h>
int main(void) {
    int i;
    printf("\n");
    for(i = 1; i < 21; i++ ) {
        printf("Value is %d\n",i);
        printf("Another one here %d\n",i);
        printf("Nothing here\n");
        printf("Final One %d\n",i);
        fflush(stdout);
        sleep(1);
    }
    printf("\n");
    return 0;
}
I have tried changing the \n's with \r's, and obviously it all ends up
on one line, and i have tried \r instead of the final \n.
Any help would be great :)
Regards,
James Mclean
"Increased knowledge will help you now.  
 Have a mate's phone bugged."
		-- /usr/games/fortune
    
    
More information about the linuxCprogramming
mailing list