Hi everybody!
i am doing a simple C++ program using Dev-C++ in which i want to display a blinking text. i had no idea about it so i went to the net and got this code with System ("CLS"). what happens is that my other outputs are gone and what is left is that text blinking so is there any ideas in which i can make the text blink and not lose my other outputs of the program. thanks
int main(int argc, char** argv) {
int i,j,rd,rd1,num,b,n;
float y[100];
bool blink;
srand (time (NULL));
do {
system("CLS"); //clears the previous output on the screen
cout<<"Process\tArrival\tCPU cycle \n";
for (i=1;i<=5;i++){ //
rd= rand() % 10 + 1; // generating a random number between between 1-10
rd1=rand() % 10 + 1;
cout<<"p"<<i<<"\t"<<rd<<"\t"<<rd1<<"\n\n";
y[i]=rd1;
}
cout<<"{"<<y[1]<<","<<y[2]<<","<<y[3]<<","<<y[4]<<","<<y[5]<<"}";
cout<<"\n\n";
// the processing goes here
cout<<"Process ........";
while (true)
{
if (blink)
cout<<"Processing";
else
system("CLS");
wait(1);
blink = !blink;
}
for (i=1;i<=5;i++){
cout<<"p"<<i<<" ";
for (n=1;n<=y[i];n++){
cout<<"*";
}
cout<<"\n";
}
cout<<"\n";
cout<<"Accept values?\n"<<"if Yes please enter 1 if No please enter 2\n";
cout<<"input: ";
cin>>num;