Page 1 of 1

Writing to same location using printf in C/C++

Posted: Wed Oct 07, 2009 4:13 am
by Jane

Code: Select all

printf("\b"); //backspaces on char
printf("\r"); //return to beginning of line
Example

Code: Select all

	for (i=0; i<1000; i++){

		printf("%d%%", i * 100/1000); // show percentage

		for (j=0; j<1000000; j++); // delay

		printf("\r");
	}