b4 the line that's segfaulting, add something like: printf("string1 points @%p\n", string1); that will tell you the address that string1 thinks the character array starts at. whatever environment you are devloping in, you should run the debugger. you should set a watch on that variable, and everytime it changes you should make sure it points to valid place. then you can ...