A few instant problems
1. Over reliance on global variables.
2. Your print routine starts at 'p', not first. Your p variable is the last node created.
3. scanf("%s",&tl);
t1 doesn't point at any memory.
At a push, the minimum would be these snippets
char t1[10];
scanf("%s",t1);
while( t1[0] != 'n' );
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Offline 7,164 posts
since Dec 2005