I believe the OP meant to describe the desire to designate a
different set of positions (number of spaces) which outputting
the TAB character skips. I don't believe C++ defines that at
all, it's the characteristic of the device with which the
output is associated.
Well, he's confirmed that, but I'll admit that the idea didn't
even occur to me. Horizontal tab is a character like any other,
and how the display device reacts to it is very, very dependent.
Practically speaking, a de facto standard of one tab stop every
eight columns has established itself today, but historically, it
really was anything goes, with the print head advancing to the
next position where someone had "configured" a tab stop (and on
some printers, the configuration consisted of moving mechanical
pieces on the printer). In the early Fortran days, 7, then
every four or five, or else only 7 and 72, were common.
Today, as I said, the de facto standard is 8, and IMHO, setting
it to anything else is more or less the equivalent of defining
operator+ to do subtraction. I rather fear that I'm not widely
followed in this opinion, however, as I am constantly running
into text which expects it to be every 2, every 3 or every 4.
Pragmatically, you can more or less assume that '\t' means
display some random number of blanks. Even if you count on 8,
and program accordingly, your output will be messed up when
someone does a diff (which inserts 2 extra characters at the
start of each line) or a grep (which inserts the filename at the
start of each line). (Historically, '\t' was used in text files
as a simple form of compression. Today, for small files, it
doesn't matter, and for big files, gzip or bzip2 are a lot more
effective. And the use of '\t' instead of spaces can interfere
with the algorithms used by gzip or bzip2, and result in less
compression.)
Anyway, the correct solution if you want to position at a
specific place in the line is to output an appropriate number of
spaces (std::setw() can help here), and not to use '\t'. The
only time you should output a '\t' is when you want a tab
character in the text, say for some external program (e.g.
make, which requires tabs in some cases), or to allow the user
to indent according to his personal preferences.