c++ - Overloading in C or not? -


How variable length length works like printf (), scanf (), etc C

and how does the call

printf ("did not work% s", s); <

printf (s, "not working% s"); Is different from

where s is defined as:

  const char * s = "string";   

Please explain.

in

  const char * s = "string"; Printf (s, "did not work% s");   

The first argument "string" is interpreted as a format string. There is no entry code in it, so the second parameter will never be used. The result will be "string".

OTOH

  printf ("no% s", s);   

is an integration code, so the second argument is inserted as a string, the result was "no string".

It is not overloading because, although different logic types are possible, in overloading, similar functions with variable logic are always called. Different tasks are said to be overloaded on the basis of logic type.

Comments