C++语言基础
用C语言的printf函数来实现5个重载的函数print(),分别对整型,长整型,字符型,字符串采用"%d","%ld","%c","%s"格式描述来显示输出,如下
void print(int i)
{
printf("%d",i);
}
[解决办法]
void print(int i)//整型
{
printf("%d",i);
}
void print(long l)//长整型
{
printf("%ld",l);
}
void print(char c)//字符型
{
printf("%c",c);
}
void print(char *s)//字符串
{
printf("%s",s);
}