/*
*函数原型:char* find_char(char const *source,char const *chars)
*函数功能:
* 如果source和chars为空,直接返回NULL;chars中的字符与source
* 中的字符不匹配也返回NULL;若匹配,则返回返回指向source中的第一
* 个匹配的位置的指针。
*/
#include<stdio.h>
char* find_char(char const *source,char const *chars)
{
char *a = source;
char *b = chars;
if(NULL == *a || NULL == *b)
{
return NULL;
}
while((*a!= 0))
{
while((*b!= 0))
{
if(*a == *b)
{
return (char*)a;
}
else
{
b++;
}
}
b