The characters will get send just like that to the underlying output device (in your case probably a terminal emulator).

It is up to the terminal's implementation then how those characters get actually displayed. For example, a bell (\a) could trigger a beep sound on some terminals, a flash of the screen on others, or it will be completely ignored. It all depends on how the terminal is configured.

Answer from ComicSansMS on Stack Overflow
🌐
Quora
quora.com › Whats-the-use-of-b-in-C
What's the use of \b in C? - Quora
Answer (1 of 5): The output of the[code ] /b [/code]escape sequence depends on compiler to compiler. 1. Various possible outputs are:Non-destructive backspace : Here, a “\b” just makes the cursor shift backwards , without erasing any data and replacing the current character encountered ...
Discussions

about escape character "\b" - C++ Forum
That is, the terminal adjusts its display to respond to the backspace code, even though it received everything prior to it. A file also receives everything, including the backspace code, but it is not a tty device so the file's content is not modified; it keeps everything you send to it. More on cplusplus.com
🌐 cplusplus.com
May 16, 2009
what does a/b/c mean? does it mean a/(b/c) or (a/b)/c? because both answers are totally unequal.
As it is written, a÷b÷c is read from left right, meaning a would be divided by b first, then the result would be divided by c. Without parentheses, though, this is typically seen as an ambiguous problem. More on reddit.com
🌐 r/learnmath
15
4
February 15, 2022
What is the opposite of \b (backspace escape sequence)?
Maybe you're interested in the ANSI escape sequences . It's better to use a library for this prupose though. More on reddit.com
🌐 r/Cplusplus
7
7
July 26, 2020
c - What do \t and \b do? - Stack Overflow
Stack Internal Implement a knowledge platform layer to power your enterprise and AI tools. Stack Data Licensing Get access to top-class technical expertise with trusted & attributed content. Stack Ads Connect your brand to the world’s most trusted technologist communities. More on stackoverflow.com
🌐 stackoverflow.com
Top answer
1 of 6
4
"\n" for new line "\b" for a backspace, means if u print it, cursor will print and come back 1 character. For example.... cout<<"hello\bHi"; will print "HellHi". because after printing Hello, compiler found a \b escape sequence. so it came 1 character back (at 'o' of Hello) and stat printing Hi from o of Hello..... so u got HellHi instead of HelloHi. · '\r' is used for carriage return to come 1 line back or in start of line. · HOPE I FIXED. MARK THIS THREAD SOLVED AND DO RATE ME
2 of 6
0
Post by jonsca and tux4life have divulged all the information related to this topic.But would like to add some from my side. · Apart from the printable characters (character which can be seen on a output screen) we make use of several other operations when working on any text. When we work on a text editor,the text editor handles all the operations on its own and keeps us away from implementation details.But in C those operations are included in the character set itself so that a user can make use of them and format his/her output in any way required. · These characters which hold a very special meaning and work instead of functions as in text editors are your "Escape Characters". · Every letter has its identity. Say character 'A' instructs the machine to store value of 65 in 1 byte to symbolise 'A'. In escape characters we tell the compiler to escape or neglect the meaning of original character and act differently by placing the '\' symbol before it.Hence the name "Escape Character". You can try something like: · cout << "TestString1__TestString2"; · and place '\a' '\b' '\c' ... and so on and test what every character does.
🌐
GeeksforGeeks
geeksforgeeks.org › c language › escape-sequence-in-c
Escape Sequence in C - GeeksforGeeks
They start with a backslash \ followed by a character (e.g., \n, \t).
Published   November 1, 2025
🌐
GeeksforGeeks
geeksforgeeks.org › c language › operators-in-c
Operators in C - GeeksforGeeks
The arithmetic operators are used to perform mathematical calculations such as addition, subtraction, multiplication, division, and modulus on numeric values. Work with integer and floating-point data types. Include unary operators like increment (++) and decrement (--) ... #include <stdio.h> int main() { int a = 25, b = 5; // using operators and printing results printf("a + b = %d\n", a + b); printf("a - b = %d\n", a - b); printf("a * b = %d\n", a * b); printf("a / b = %d\n", a / b); printf("a %% b = %d\n", a % b); printf("+a = %d\n", +a); printf("-a = %d\n", -a); printf("a++ = %d\n", a++); printf("a-- = %d\n", a--); return 0; }
Published   1 month ago
🌐
Sololearn
sololearn.com › en › Discuss › 2016569 › what-does-the-b-r-t-a-do-in-c-programming
What does the /b /r /t /a do in c programming | Sololearn: Learn to code for FREE!
September 26, 2019 - They exist because escape characters don't have own character, there is no 1 character representatikns for characters, such as newlines and tabs, so they are represented as backslash \ followed by a character. \b represents a backspace \r represents ...
🌐
Cplusplus
cplusplus.com › forum › general › 11059
about escape character "\b" - C++ Forum
May 16, 2009 - The '\b' escape is so called because in C (and C++) it is written using the 'backslash escape sequence'. The '\b' really translates to the ASCII BS code -- or the value 8 -- also writeable as '\010' or '\x08' (...unless you are using an EBCDIC system or some other ancient piece of cruft, in ...
Find elsewhere
🌐
Quora
quora.com › What-does-b-do-in-a-C-program-1
What does \b do in a C program? - Quora
Answer (1 of 7): These character sequences that start with a \ are called as escape sequences. These translate into something rather that being used literally in a string literal. For ex \n is translated to a new line character, \b translates to backspace. Go through the following article for mo...
🌐
Unstop
unstop.com › home › blog › escape sequence in c | a guide to all 15 types +code examples
Escape Sequence In C | A Guide To All 15 Types +Code Examples
May 7, 2025 - Escape sequences provide a way to represent characters in programming that have a different meaning than their literal appearance. These sequences begin with a backslash (\) followed by a character, allowing programmers to include characters in their code that are otherwise difficult to type or have special functions.
🌐
Sololearn
sololearn.com › en › Discuss › 1790723 › what-is-the-use-of-b-escape-character-in-c-programming-
What is the use of '\b' escape character in c programming
I'm trying to delete a course like: c, python, and its not working!!!!!!! ... I'm doing java and python but evrebody is saying that nobody uses python is thst true sould I switch language
🌐
Wikipedia
en.wikipedia.org › wiki › Escape_sequences_in_C
Escape sequences in C - Wikipedia
March 16, 2026 - In the C programming language, ... to the compiler. It allows a programmer to specify characters that are otherwise difficult or impossible to specify in a literal. An escape sequence starts with a backslash (\) called the escape character and subsequent characters define ...
🌐
Reddit
reddit.com › r/learnmath › what does a/b/c mean? does it mean a/(b/c) or (a/b)/c? because both answers are totally unequal.
r/learnmath on Reddit: what does a/b/c mean? does it mean a/(b/c) or (a/b)/c? because both answers are totally unequal.
February 15, 2022 - As it is written, a÷b÷c is read from left right, meaning a would be divided by b first, then the result would be divided by c. Without parentheses, though, this is typically seen as an ambiguous problem. ... Meaning that PEMDAS is not universally accepted. ... Absolutely agree! ... We're going to start charging people $5 when they post expressions using / and then don't use parens (or other visual cues in images) to identify operator scope.
🌐
Wikipedia
en.wikipedia.org › wiki › Operators_in_C_and_C++
Operators in C and C++ - Wikipedia
1 week ago - Most of the operators available in C and C++ are also available in other C-family languages such as C#, D, Java, Perl, and PHP with the same precedence, associativity, and semantics. Many operators specified by a sequence of symbols are commonly referred to by a name that consists of the name ...
🌐
Wikipedia
en.wikipedia.org › wiki › Bitwise_operations_in_C
Bitwise operations in C - Wikipedia
June 18, 2026 - Bitwise operations are contrasted by byte-level operations which characterize the bitwise operators' logical counterparts, the AND, OR, NOT operators. Instead of performing on individual bits, byte-level operators perform on strings of eight bits (known as bytes) at a time.
🌐
YouTube
youtube.com › watch
B: The Programming Language That Inspired C - YouTube
In this video I will make a short demonstration of the B Programming Language, this language came before C and is quite similar.Docs:- https://www.bell-labs....
Published   May 27, 2023
Top answer
1 of 5
78

No, that's more or less what they're meant to do.

In C (and many other languages), you can insert hard-to-see/type characters using \ notation:

  • \a is alert/bell
  • \b is backspace/rubout
  • \n is newline
  • \r is carriage return (return to left margin)
  • \t is tab

You can also specify the octal value of any character using \0nnn, or the hexadecimal value of any character with \xnn.

  • EG: the ASCII value of _ is octal 137, hex 5f, so it can also be typed \0137 or \x5f, if your keyboard didn't have a _ key or something. This is more useful for control characters like NUL (\0) and ESC (\033)

As someone posted (then deleted their answer before I could +1 it), there are also some less-frequently-used ones:

  • \f is a form feed/new page (eject page from printer)
  • \v is a vertical tab (move down one line, on the same column)

On screens, \f usually works the same as \v, but on some printers/teletypes, it will go all the way to the next form/sheet of paper.

2 of 5
38

Backspace and tab both move the cursor position. Neither is truly a 'printable' character.

Your code says:

  1. print "foo"
  2. move the cursor back one space
  3. move the cursor forward to the next tabstop
  4. output "bar".

To get the output you expect, you need printf("foo\b \tbar"). Note the extra 'space'. That says:

  1. output "foo"
  2. move the cursor back one space
  3. output a ' ' (this replaces the second 'o').
  4. move the cursor forward to the next tabstop
  5. output "bar".

Most of the time it is inappropriate to use tabs and backspace for formatting your program output. Learn to use printf() formatting specifiers. Rendering of tabs can vary drastically depending on how the output is viewed.

This little script shows one way to alter your terminal's tab rendering. Tested on Ubuntu + gnome-terminal:

#!/bin/bash
tabs -8 
echo -e "\tnormal tabstop"
for x in `seq 2 10`; do
  tabs $x
  echo -e "\ttabstop=$x"
 done

tabs -8
echo -e "\tnormal tabstop"

Also see man setterm and regtabs.

And if you redirect your output or just write to a file, tabs will quite commonly be displayed as fewer than the standard 8 chars, especially in "programming" editors and IDEs.

So in otherwords:

printf("%-8s%s", "foo", "bar"); /* this will ALWAYS output "foo     bar" */
printf("foo\tbar"); /* who knows how this will be rendered */

IMHO, tabs in general are rarely appropriate for anything. An exception might be generating output for a program that requires tab-separated-value input files (similar to comma separated value).

Backspace '\b' is a different story... it should never be used to create a text file since it will just make a text editor spit out garbage. But it does have many applications in writing interactive command line programs that cannot be accomplished with format strings alone. If you find yourself needing it a lot, check out "ncurses", which gives you much better control over where your output goes on the terminal screen. And typically, since it's 2011 and not 1995, a GUI is usually easier to deal with for highly interactive programs. But again, there are exceptions. Like writing a telnet server or console for a new scripting language.

🌐
Learn C++
learncplusplus.org › home › c++ › what is a b in c programming?
What Is A B In C Programming? - Learn C++
November 9, 2022 - It was easy to create more generalized code than it was in assembly language, and this encouraged the adoption and spread of the C programming language as a viable alternative to the more cumbersome and onerous assembly instructions with minimal compromises. But did you know there was a B in C programming?
🌐
TutorialsPoint
tutorialspoint.com › cprogramming › c_operators.htm
C - Operators
The most common relational operators are less than (<), greater than (>), less than or equal to (<=), greater than or equal to (>=), equal to (==), and not equal to (!=). Relational operators are also binary operators, needing two numeric operands. ... Here, ">" is a relational operator. We shall learn more about with relational operators and their usage in one of the following chapters.
🌐
W3Schools
w3schools.com › c › c_operators.php
C Operators
C Examples C Real-Life Examples C Exercises C Quiz C Code Challenges C Practice Problems C Compiler C Syllabus C Study Plan C Interview Q&A ... Operators are used to perform operations on variables and values. In the example below, we use the + operator to add together two values: