Here is a scroller program that i made
Code:
/*
Name: Scroller
Copyright: 2005
Author: Sridar Ravi
Date: 05/04/05 18:31
Description: A scrolling text program
*/
#include <iostream>
#include <time.h>
using namespace std;
//*****************************************************************************
void wait(long milliseconds)
{
long timeout = clock() + milliseconds;
while( clock() < timeout ) continue;
}
void Scroll(string &msg)
{
string scrolled,temp,temp2;
temp=msg.substr(1,(msg.length()));
temp2=msg.substr(0,1);
msg=temp+temp2;
if(msg.length()+1==' ')
{
cout<<temp+' '+temp2;
}
else
{
cout<<msg;
}
}
//*****************************************************************************
int main()
{
string msg;
cout<<"Enter the message that you wish to display as scroller: ";
getline(cin,msg);
msg=msg+". ";
int x=0;
while(1)
{
Scroll(msg);
wait(100);
system("cls");
x++;
}
cin.get();
return 0;
}
Hope it helps.