error C2664 C语言的一个问题~~~~~~

来源:百度知道 编辑:UC知道 时间:2024/06/06 15:22:23
#include<stdio.h>
char *delk(char *sp)
{
for(;*sp!='\0';sp++)
if(*sp=='$') printf('\b');
}
main()
{
char a[100];
gets(a);
*delk(a);
printf("%s",a);
}
这是我程序 编译的时候出现错误
error C2664: 'printf' : cannot convert parameter 1 from 'const char' to 'const char *'
Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast
这是怎么回事啊

#include<stdio.h>
char *delk(char *sp)
{
for(;*sp!='\0';sp++)
if(*sp=='$') printf("\b");//这里需要双引号

return sp;//你定义了返回值,就必须返回个东西
}

void main()
{
char a[100];
gets(a);
delk(a);//不加*
printf("%s",a);
}