[ create a new paste ] login | about

Link: http://codepad.org/m76sEjpK    [ raw code | output | fork ]

C++, pasted on Aug 26:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <stdio.h>
void fun(char * a)
{
    int i = 0, j = 0;
    while (a[i] == '*')
        i++;
    for (; a[i] != '\0'; i++, j++)
        a[j] = a[i];
    a[j] == '\0';
}
int main()
{
    char str[] = "123**aa";
    fun(str);
    printf("%s", str);
    return 0;
}


Output:
1
123**aa


Create a new paste based on this one


Comments: