I use this function to enter characters. As far as I know, the '\t' character includes 8 spaces. This function proved it, but as it turned out, it was not always (?) Enter, for example, 10 units. And then click tab . So, the program does not print 8 spaces. They will be less. The next tab press obediently prints an indent, 8 spaces wide. What caused this behavior?

    1 answer 1

    A tab is not a specific number of spaces, but an alignment of the next displayed character to the specified number.

    And it depends on the settings of a specific environment / editor - which alignment to use.

    In your example, if the tabs are aligned by 8 characters, then after the output of 10 units, until the next tabulation (16) there are 6 empty places left

    _getche() nothing to do with it at all ... As, actually, C.

    • Thank you so much, did not know this at all. You really helped - Range
    • Well, if the answer is arranged - mark as accepted :) - Harry
    • The forum did not give, only now it is possible) - Range