\a ?

My instructor gave us some sample code and she used a \a
Can someone tell me what it is used for? I can't find it online or in my textbook?

1
2
cout <<"This program processed "<<counter<<" numbers."<<endl;
	 cout <<"The total value of the numbers is "<<totValue<<"\a \n\n";
Last edited on
'\a' is the escape character for a beep ( a = alert )

http://www.cplusplus.com/doc/tutorial/constants.html
Last edited on
Thank You
All Escape Character have its importance in C++.
I am sending u some common Escape characters.

\a = alarm or alert
\b = it is used for backspace.
\t = it is used for tab(long space)
\n = it is used for new line.
\f = it is used for form feed.
\r = it is used for return to the start of the same line.
\\ = it is used to print one back slash.
\" = it is used to print the inverted commas.

All these escape characters will be used in double commas.


I think just reading them is not sufficient. you should make practice of all these urself atleast once than all will be clear.
Thanks
Last edited on
There should be a few more than those:
\' = single quote
\v = vertical tab
\? = '?'
\ (octal number) and
\x (hexadecimal number) = corresponding ASCII character
\ (newline) = the string continues on the line below

all of those can be used both in single quotes and double quotes
Last edited on
Printed and filed with schoolwork...Thanks again for the help
Topic archived. No new replies allowed.