Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tab '\t' has inconsistent spacing

Tags:

c++

format

I am using \t to space out my output, but it produces inconsistent spaces.

For example, the following code produces

#include <iostream>

int main()
{
    std::cout << "Terms\tResults\tet(%)\tea(%)\n";
    return 0;
}

Terms Results et(%) ea(%)

Note the difference in space

Why is this so?

like image 331
CroCo Avatar asked Sep 07 '25 09:09

CroCo


1 Answers

Tab ends each 8th column.

v       v       v       v       v
1234567812345678123456781234567812345678
Terms   Results et(%)   ea(%)
like image 189
Qwertiy Avatar answered Sep 10 '25 07:09

Qwertiy