string

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chandru50
    New Member
    • Dec 2006
    • 5

    string

    i need a program to remove commas from a string.can anyone help? tks chan
  • jningombam
    New Member
    • Dec 2006
    • 3

    #2
    Originally posted by chandru50
    i need a program to remove commas from a string.can anyone help? tks chan


    main()
    {
    char *input, output[50];
    int i;
    /*"input" point to the required string
    So make the "input" pointer point to the input string*/
    printf(" input val = %s\n", input);

    while(*input != '\0')
    {
    if(*input != ',')
    {
    output[i]=*input;
    i++;;
    input++;
    }
    else
    input++;
    }
    printf("output val %s\n",output);
    }
    See if this help you......

    Comment

    Working...