
Well don't get sooo angry...
I said just count characters while you are printing on screen
and avoid the escape characters you get from file.
And is it compulsary for you to have it in array? I can't find any reason to have array to handle line length. But still if you want it with array then store those characters one by one in array instead of printing and print whole array when you reach the length
It's something like...
CODE
char ch;
int count =0;
int length = 40; // you can change your line length here.
while(!inputfile.eof()) //check for end of file
{
if(count>length) // line length reached. go to new line, reset counter.
{
count =0;
cout<<"\n";
}
inputfile.get(ch); //get a character
if(ch!='\n' && ch!='\t') //check it's not an escape character
{
count++; //character to be printed increment count.
cout<<ch; //print it.
}
}
ignore any syntax errors there and try to get the logic of printing...
some adjustments here and there might be needed as I didn't tried to
run it...
It's all about cool mind...

Think on it and you will get it.
hope this will hope you...
This post has been edited by AmitTheInfinity: 27 Feb, 2007 - 11:30 PM