I have the code to make the text roll. But the problem is that the application can't execute other instructions coz its busy in the infinite loop of the marquee. How do i make the application to execute its normal instructions as well as roll the text simultaneously
You could try including function calls to the other instructions inside of the infinite loop. That would allow you to do just about anything, although you would have to have some system of telling the loop when it is or is not appropriate to call each function.
but that would be as if i am running the code of the application from the loop, whereas the marquee should be just a visual element of the application, and if suppose i have a class 'marquee', then this solution just wont work. Probably the solution is related to multi-threading. e.g.http://www.cplusplus.com/forum/unices/104323
Like I said, you just run it in an infinite loop, and have the loop poll the different functions to see if anything needs to be updated. It wouldn't really be that difficult to do, and you wouldn't have to jump into the threading.
void marquee()
{
const string text = "Hello World!";
string outText = text;
while (true)
{
//output outText
//change the text one char position ex. ello World!
//Delay a bit. You don't want it to go too fast. :)
//clear the screen
// you will want some kind of exit statement
}
}