Hi
Is there any way to get output text (cout) blinking
Thanks
Wanex
Hi
Is there any way to get output text (cout) blinking
Thanks
Wanex
Not directly... though with a little ingenuity, you could figure out something. Perhaps have the output cleared and re-outputted every 1/2 second with alternating colors... One the color of the background, the other not.
Sent from my iPadŽ
here's one way to do it:...but don't do that... and the speed of the blinking depends on your computer... it'll try to make it blink as fast as it can...Code:#include <iostream> int main() { for(register short int i=0;i<3000;i++) { if(i<1500) { std::cout<<"\b\b\b\b\b\b\b\b\b\b\b" <<"Hello "<<std::flush; } else { std::cout<<"\b\b\b\b\b\b\b\b\b\b\b" <<" World"<<std::flush; } i=(i+1==3000?0:i); } return 0; }
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
Works fine, thank you
no, doesn't work fine... don't use that... check your processor when you run that code >.<
Join is in our Unofficial Cprog IRC channel
Server: irc.phoenixradio.org
Channel: #Tech
Team Cprog Folding@Home: Team #43476
Download it Here
Detailed Stats Here
More Detailed Stats
52 Members so far, are YOU a member?
Current team score: 1223226 (ranked 374 of 45152)
The CBoard team is doing better than 99.16% of the other teams
Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)
Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT
MS-DOS 6.X and earlier had a blinking text attribute bit. But according to this Microsoft uses that bit for something else, probably because it was rarely used by anybody. Myself, I think blinking text is hideous and any programmer using it should be shot on site
Yeah, That Code Is Way To Hard On The Processor. When I ran the code, My CPU Usage went up From 0% to 45%.
-Kyle
don't forget to include <windows.h>Code:int main() { while(1) { system("cls"); Sleep(200); cout << "Blinking output"; Sleep(200); } }
Operating Systems:
- Ubuntu 9.04
- XP
Compiler: gcc