Code
int main()
{
char arr[1000];
char *temp=NULL;
char *temp1=malloc(100);
int len;
");
gets(arr);
len=strlen(arr);
puts(arr);
",len);
temp=strtok(arr," ");
if(temp!=NULL)
strcpy(temp1,temp);
while(temp!=NULL)
{
temp=strtok(NULL," ");
if(strstr(temp1,temp)==NULL)
{
strcat(temp1," ");
strcat(temp1,temp);
}
}
strcpy(arr,temp1);
return 0;
}
Copyright GeekInterview.com
This is giving me runtime error why ?
Removing duplicate words from a string
This is giving me runtime error why ?
Questions by pro_learner
Related Answered Questions
Related Open Questions