When you call
printf
, you can provide a number of arguments. The first is the format, and it is mandatory - it tells the function what it is to do.
The format string you provide contains characters to print "\nName: " and "type specifiers" which describe the rest of the arguments - these are always a percent character followed by at least one other character, which describes the data.
%c character
%d decimal (integer) number (base 10)
%e exponential floating-point number
%f floating-point number
%i integer (base 10)
%o octal number (base 8)
%s a string of characters
%u unsigned decimal (integer) number
%x number in hexadecimal (base 16)
%% print a percent sign
You are telling it to print a string:
printf("\nName : %s",name);
But
name
is defined as a character:
void display(char name, ...
A string requires an address, not a character value!
I'd suspect that you want to pass a
char*
to your
display
function, since most people have more that a single character in their names!