One problem you have is that you need to be passing a reference to your pointer (**listPtr) so that you can MODIFY your pointer, not the list. Next, you'll need to assign the head of the list to that pointer (*listPtr = xPtr) at the end. You have two cases for inserting: when *listPtr == NULL, and when *listPtr != NULL.

That's exactly right. Which is why you should immediately infer that you are trying to access some member xPtr of the struct. If I was to bet between you and the compiler being right, I would bet on the compiler 99.9999% of the time, and if you know what is good for you so would you.

1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.

Not sure what you said but I am assuming you have a problem with the fact that on the second run the enter key from the last scanf is read as a new string from the stdin stream therefore not allowing you time to read another string. You should read the FAQ on this site, it explains the problem in detail and explores several solutions and workarounds to "eat up" that \n.

1. Get rid of gets(). Never ever ever use it again. Replace it with fgets() and use that instead.
2. Get rid of void main and replace it with int main(void) and return 0 at the end of the function.
3. Get rid of conio.h and other antiquated DOS crap headers.
4. Don't cast the return value of malloc, even if you always always always make sure that stdlib.h is included.