Submitted Questions

  • removing duplicate words from a string

    {geshibot language="c"}int main() { char arr[1000]; char *temp=NULL; char *temp1=malloc(100); int len; printf("enter the string: "); gets(arr); len=strlen(arr); puts(arr); printf("len:%d ",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); printf("arr:%s",arr); return...

    Vipul Behl

    • Oct 4th, 2015

    There is an easier way to do this, you can easily do this by using string functions strtok and strstr. See the code."c #include #include int main() { char s1[100],s2[100]; c...

    mangesh

    • Feb 18th, 2015

    How can we failed procedure in normal plsql code.