They are used to format the arguments passed along with the (format) string. It can be used for padding, precision, conversion, etc. It separates the locale (language) string from the variables/code. It also tends to be way easier to type variables into a string than doing
" + var + " every time.
Here's a cheat sheet that popped up in google with 'format string C++'. Check out it's examples.
http://www.cplusplus.com/reference/clibrary/cstdio/printf/
I suggest trying to try making a format string to format a floating point number for money (note: never use floating points to represent money in a real application). Bonus points: make it a function that returns the string. Assumably there is a way to use format strings beside printf.
In case your wondering how printf gets away with a variable number of arguments, the feature is called
varargs in Java. Not sure what it is called elsewhere. Anyone know?