How to delete the content of outputted?I want to delete the content of '*' on console.I used the "\b" on the printf statement.But the code can not implement this function.Because it delete one line only.The code as follows:
#include"stdio.h"
#include"stdlib.h"
#include"windows.h"
#include"stdio.h"
main(){
int i,j,k;
k=0;
char a[2][2]={{'*','*'},{'*','*'}};
for(i=0;i<=1;i++){
for(j=0;j<=1;j++){
printf("%c",a[i][j]);
}
if(k>=1)
;
else
printf("\n");
k++;
}
Sleep(2000);
printf("\b\b\b\b \n");
system("pause");
}
No long after,I found it can implement the function when added the statement of "system("cls")".The modified as follows:
#include"stdio.h"
#include"stdlib.h"
#include"windows.h"
#include"stdio.h"
main(){
int i,j,k;
k=0;
char a[2][2]={{'*','*'},{'*','*'}};
for(i=0;i<=1;i++){
for(j=0;j<=1;j++){
printf("%c",a[i][j]);
}
if(k>=1)
;
else
printf("\n");
k++;
}
Sleep(2000);
printf("\b\b\b\b \n");
Sleep(2000);
system("cls");
system("pause");
}
Congratulations @sky-999! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :
You can view your badges on your Steem Board and compare to others on the Steem Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!
It's great seeing your progress. Wishing you the best success.
Thanks for posting in the #programming community. Upvoted.