Sometimes I just need a hit to the head.
It does work and it does remove reapeating characters and extra white spaces from the space bar but I could not get it to remove extra spaces due to tabs
Code:
do
{
//Read input data 1 character at at time
while((current = cin.get()) != '/n')
{
if(current != previous)
{
cout << current;
previous = current;
}
}
cout << endl << endl;
} while(current == '\n');
return 0;
}
That is why I went to the other code. I handled the words white spaces and tabs but I would have to add to it to remove the repeating characters. I have tried to add
Code:
if(previous == '\t' && current != ispace(current))
{
putchar(' ');
}
I just cant figure out how to get rid of unwanted tabs this way. Any suggestions?