Often when I use string in my program it shows no error during compilation but at runtime it shows segmentation fault (core dumped). When there is still no error why doesn't it work? (I do it in linux environment (ubuntoo))
It seems you're trying to use memory space which is not already allocated. It happens that it's too complicated to find which instruction leads to this type of error. If you're in this case, I might advice you to use a debugger like GDB. It's easy to use it if it's integrated to a IDE (like Eclipse CDT).
Adding a point to above answers, it could be the case when you try to access the address (instruction pointer) of an instruction which is out of scope or not an valid address having instruction .