by Dinesh Thakur Category: Array
#include <stdio.h>

int main()
{
  char str[100], copy_str[100];
  char *pstr, *pcopy_str;
  pstr = str;
  pcopy_str = copy_str;
  clrscr();
  printf (" \n Enter the string: ");
  gets (str);
  pstr = str;
   while(*pstr != '\0')
   {
             if(*pstr != ';')
             {
               /* Do Nothing */
             }
      if (*pstr == ';')
      {
       *pcopy_str = ', ';
      }
             else
            {
             *pcopy_str =*pstr;
            }
                 pstr++; pcopy_str++;
   }
     *pcopy_str ='\0';
     printf("\n The new text is:");
     pcopy_str = copy_str;
   while(*pcopy_str != '\0')
   {
     printf("%c", *pcopy_str);
     pcopy_str++;
   }
     return 0;
}

  delete all the semicolons it has, and finally replace all '.' with a ','



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Related Articles