+ 1
When and how do you use a \a escape sequence?
I came across this article on escape sequences. Have you used \a before? https://docs.microsoft.com/en-us/cpp/c-language/escape-sequences?view=msvc-170
1 Answer
+ 1
\a escape sequence is use for making a beep sound
it tells the compiler to produce a beep sound.
so whenever a compiler encounters a \a sequence, it produces a beep sound from the speakers of your system.
for example,
#include <stdio.h>
int main() {
printf("1\a2\a3\a4\a5\a6\a7\a8\a9\a0");
return 0;
}
This code will print 1 and make beep sound then 2 (beep sound)
then 3 beep sound
then 4 beep sound
and so on.
But in SoloLearn it does not works!
maybe it is not supported here.