Home > Back-end >  Simple question: function overloading
Simple question: function overloading

Time:01-11

 
Int calc (char *, char *);
Int calc (const char *, char * const);

Why these two functions is defined as repeated definition;

CodePudding user response:

Personal understanding, char * const, the parameters of the type or is const char * just parameters, so with char * repeat it to avoid ambiguities
Change
Calc (const char *, const char *)
  • Related