printf() is a C function used for printing to standard output (a.k.a. your command prompt, for instance). It takes a string including
format specifiers, the %somethings you see. A simple example is:
1 2
|
int myVar = 15;
printf("myVar = %d", myVar);
| |
The code reads the string and finds %d, which is a signal that it should print an integer value. It finds myVar, sticks that value into the string, and prints the string There are other format specifiers, like %c for a character, %s for a string, %f for a floating-point number, etc. etc.
It is also the modulus division operator, as Mayflower said.
If you are using C++, you shouldn't have to worry at all about format specifiers - cout and cin are pretty smart at figuring our what you are outputting/inputting.