Kamis, 06 November 2008

Constants

There are three constants in C Language it's Special Character Constants (escape sequences), String Constants, Symbolic Constants.

Special Character Constants (Escape Sequences)
\n - newline
\r - carriage return
\a - bell
\t - horizontal tab
\f - from feed
\v - vertical tab
\\ - backslash. As the character '\' is alreadyy used to indicate the start of escape sequences, a double slash is needed to print the slash character.
\" - quotion mark. As the quotion mark is already used to mmark the start and end of a string, \" - is needed to print the quotion ark itself.
\% - precentage sumbol. As % is already used in the format specifier, \% is needed to print the % character.

String Constants
"Hallo World"
printf ("Hallo World\n");
The string constants is always inside " " signed.

Symbolic Constants
#define
define symbols for constants of integer float, character or string type.

I hope you understand with these three constants, command me for more information.

1 komentar:

Unknown mengatakan...

Thank yaw atas Informasnya
semuanya sangat membantu dalam perkuliahan saya! peace!