Escape sequences


The following is a list of escape sequences.

	\n 	Newline
	\t	Horizontal Tab
	\v	Vertical Tab
	\b	Backspace
	\r	Carriage Return
	\f	Form feed
	\a	Audible Alert (bell)
	\\	Backslash
	\?	Question mark
	\'	Single quote
	\"	Double quote
	000円	Oct - No one uses Octal unless they have an ICL background...
	\xhh	Hex number
	 	Decimal table just for fun.
 \ Preprocessor line continuation, must be immediately followed 
	 by a newline.

These can be used anywhere that C expects to see a character constant. Must be time for a quick example.

	main()
 {
	 char word[]="\x6d\x6f\x64\x65\x6d"; 
	 
	 printf("%s\n", word);
	}

Cant you work out what will appear if you ran this program??


Examples:

Example program.



Martin Leslie

AltStyle によって変換されたページ (->オリジナル) /