[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
CPrintf
It also uses '''escape characters'''. Escape characters start with \ and have another character following it to represent a display (or sound in one case) command. See a list below.
Examples:
In C++ std::cout is used more commonly.
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
CPrintf
(C) printf
A function that lets the computer know that it is going to print something on the screen. It can even display variables as well as strings.It also uses '''escape characters'''. Escape characters start with \ and have another character following it to represent a display (or sound in one case) command. See a list below.
Examples:
int main() { int myInt = 0; char myChar = 'd'; char myString[] ="Hello, world!"; printf("myInt equals: %i\n" ,myInt); printf("myChar equals : %c\n" ,myChar); printf("MyString equals: %s\n",myString); return 0; }
- include <stdio.h>
In C++ std::cout is used more commonly.
Escape characters
\n Newline \r Carriage Return \a Alert (Beep) \\ Prints a \ on the screen \" Prints a " on the screen \f Formfeed \t Horizontal tab \v Vertical tab \### The octal value where ### is a digit between 0 and 7 \xHH The Hexadecimal value where HH are hexadecimal digits (0 through 9 or a through f)
Conversion specifiers
See specifiers.'printf' links
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
