Hi Im having troubles with this function. Help would be greatly appreciated as im not very good with this stuff.
Heres what I have to do: The function must find the first character in the chain pointed by glaPtr that is not in the chain pointed by alreadyseenPtr. It must return this character. If all characters in the first chain are in the second chain, the function must return '\0'.
Ex1:
alreadyseenPtr AG
glaPtr AGS
Function must return S
Heres what I have so far and I dont think its doing its job good as my program isnt working:
Heres what I have to do: The function must find the first character in the chain pointed by glaPtr that is not in the chain pointed by alreadyseenPtr. It must return this character. If all characters in the first chain are in the second chain, the function must return '\0'.
Ex1:
alreadyseenPtr AG
glaPtr AGS
Function must return S
Heres what I have so far and I dont think its doing its job good as my program isnt working:
char function3(char *glaPtr, char *alreadyseenPtr)
{
char next;
int flag;
next = '\0';
flag = 1;
while (next = '\0' && flag == 1)
{
next = *strchr(dejaVuPtr, *synthesePtr);
if (next != NULL)
{
next = *synthesePtr;
flag = 0;
}
else
{
glaPtr++;
}
}
return (next);
}
Last edited: