learning C++ and going through some codes. I'm puzzled by how the following piece of code works. It's from the msdn library as part of an example, and I know that the code works, but I'm puzzled by how the "%" sign works.
#include "stdafx.h"
#include <stdio.h>
int main ()
{
char buffer [50];
int n, a=5, b=3;
n=sprintf (buffer, "%d plus %d is %d", a, b, a+b);
printf ("[%s] is a %d char long string\n",buffer,n);
return 0;
}
if someone can explain it to me, it'll be great