actually, I wasn't assigning a number to a point. *i is dereferencing a pointer. *i = 3 is to let i point to value 3. I'm still confused why this caused the seg fault.

This is a simplified version of the problem. Originally, I wanted to manipulate a string parameter in a function. It seems as long as I change the value pointed by a pointer (this pointer is a parameter to a function), seg fault appears...