c语言,函数指针.exe - 0 error(s), 0 warning(s),怎么会没有结果??
#include<stdio.h>#include<string.h>char*fun(char*p1,char*p2){inti=0;i=strcmp(p1,p2);i...
#include <stdio.h>
#include <string.h>
char *fun(char * p1,char * p2)
{
int i=0;
i=strcmp(p1,p2);
if(0==i)
return p1;
else
return p2;
}
int main()
{
char * (*pf)(char *p1,char *p2);
pf=&fun;
(*pf)("a","b");
return 0;
} 展开
#include <string.h>
char *fun(char * p1,char * p2)
{
int i=0;
i=strcmp(p1,p2);
if(0==i)
return p1;
else
return p2;
}
int main()
{
char * (*pf)(char *p1,char *p2);
pf=&fun;
(*pf)("a","b");
return 0;
} 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询