TAB SIZE PROBLEM

Hi,
I have to make a program in c++ which reads a text file and prints it out.The tricky part is that when it reads 4 spaces in row it has to convert it to '\t' so the optical result is the same.Well the problem is that when i am using '\t' it displays at the console 5 spaces and not 4 or 8. I have tested it in win7 and linux but the result is the same.Please guys need help!Sorry for bad english btw!
Thanks!
What your console chooses to display to represent a \t has nothing at all to do with C++. It is to do with your console settings.
Well I totally agree with you but is there a way to modify it ?
You are going the wrong way. Convert all tabs to spaces so that things line up the way you want no matter what the console settings.

(BTW, users that change the tab size on their console to something other than 8 deserve whatever horrors they get...)
Topic archived. No new replies allowed.