0
Please guys I need some help here , how can I make a text or a string blink in C++ and in C also ?! And thanks anyways !
6 ответов
0
while(true)
{
cout << "blinking text";
system("cls"); // stdlib.h
Sleep(1000); // only for windows - windows.h
}
0
I have an error while building and running that says : "[Error] 'sleep' was not declared in this scope" !!
0
you need to be on windows and include the header file "windows.h"
0
I'm on windows actually , and I just typed the code typically , but it got me that error I mentioned earlier ! do you know what is the reason ?!
0
you need to type this code in the main method.
you need a modern compiler (basically anything except turbo c compilers).
if it still doesn't work then I'm not really sure what else to do..
edit - you could also replace the sleep function with a for loop like this-
for(int i = 0; i < 99999; i++);
this basically eats away the memory and causes a delay. play around with the i < value and see what fits your need.
0
@Nikunj Arora thank you anyways , and sorry for bothering you 😊