I have made some changes to the PI substitution program, please suggest the problem as I am getting seg error

https://codeshare.io/aJXd1q

#include
#include
using namespace std;

char* piSubstitution(char a){
int i = 0;
if(
(a+i) == ‘\0’ || (a+i+1) == ‘\0’)
return a;
if(
(a+i) == ‘p’ && *(a+i+1) == ‘i’){
int j = i+2;
while(a[j] != ‘\0’)
j++;
while(a[j] >= i+2){
a[j+2] = a[j];
j–;
}
a[i] = ‘3’;
a[i+1] = ‘.’;
a[i+2] = ‘1’;
a[i+3] = ‘4’;

    return piSubstitution(a + i + 4);
}
else{
    return piSubstitution(a+i);
}

}

int main(){
char a[100] = “sdblpikjfgpilbudfpi;ehfdhapidfbkabpi”;

cout<<piSubstitution(a);

}

you dont need to go through recursion to solve this problem you can simply iterate the string and print 3.14 whenever you encounter pi, It is generally not a good idea to append and move elements to the given string as it is error prone and increases the time complexity.
Code

Thats okay, but still what is the issue with the code…why is it giving segmentation error

But still what is the issue in the code