help me out in implementing the following code iteratively . I m having problem actually cannot think how to implement last recursive call in the match function .http://www.geeksforgeeks.org/wildcard-character-matching/
// A C program to match wild card characters
#include <stdio.h>
#include <stdbool.h>
bool match(char *first, char * second)
{
if(*first=='\0'&&*second=='\0')
return true;
else if((*first=='*'&&*(first+1)!='\0'&&*second=='\0'))
return false;
else if((*first=='?')||*first==*second)
return match(first+1,second+1);
else if(*first=='*')
return match(first+1,second)||match(first,second+1);
return false;
}
// A function to run test cases
void test(char *first, char *second)
{ match(first, second)? puts("Yes"): puts("No"); }
// Driver program to test above functions
int main()
{
test("g*ks", "geeks"); // Yes
test("ge?ks*", "geeksforgeeks"); // Yes
test("g*k", "gee"); // No because 'k' is not in second
test("*pqrs", "pqrst"); // No because 't' is not in first
test("abc*bcd", "abcdhghgbcd"); // Yes
test("abc*c?d", "abcd"); // No because second must have 2 instances of 'c'
test("*c*d", "abcd"); // Yes
test("*?c*d", "abcd"); // Yes
return 0;
}