Everything except for the main method was written by my professor, so supposedly it should work. For reference, I'm pretty sure this code is supposed to remove any repeating letters from a string, turning "blaahhhblah" into "blahblah". This code compiles with no errors or warnings (compiled under the 1999 standard) but gives a seg fault when I run it and I have no idea why. I feel like there's probably an obvious answer to this, but we don't use a book for this course and the professor hasn't taught very well so I'm lost.
void g(char* a) {
char* b = a;
while(*b) {
while(*a == *b)
b++;
a++;
a* = b*;
}
}
int main() {
char* x = "blaahhhblah";
g(x);
}