strchr

Joined
Nov 15, 2008
Messages
5
Reaction score
0
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:

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:
Joined
Nov 15, 2008
Messages
5
Reaction score
0
sry for bumping but im really really really desperate. Assigment is due tomorrow morning and still cant figure it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top