Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<stdio.h>
- #include<stdlib.h>
- struct ch{
- char c;
- struct ch *next;
- } *first;
- struct Member {
- char *name1,*name2;
- struct Member *Next;
- } *FName;
- int scan(void);
- int main()
- {
- first=NULL;
- FName=NULL;
- scan();
- return 0;
- }
- int scan(void)
- {
- int M,i,count;
- struct ch *O;
- O=(struct ch *)malloc(sizeof(struct ch));
- O=first;
- scanf("%d",&M);
- for(i=0;i<M;i++)
- while(scanf("%c",&first->c))
- {
- O=first->next;
- if(first->c==' ')
- if(!count)
- {
- struct Member *oldfirst;
- oldfirst=(struct Member *)malloc(sizeof(struct Member));
- oldfirst=FName;
- FName->name1=(char *)malloc((count+1)*sizeof(char));
- for(i=0;i<count;i++)
- {
- *FName->(name1+i)=first->c; /*Error*/
- first=first->next;
- }
- *FName->(name1+count)='