you make me smile, I faced the same problem for such a long time
Segmentation fault occurs when you try to access memory that you are not allowed to access,
I works in Turbo C because inside windows turbo C works in an emulated Virtual Machine.
If you try to run it under Win32 e.g on Visual C++ you will get the same error, called access voilation.
to correct this , allocate the memory before you access it
dont do
char * name;
name="abc";
just do it like
char * name;
name=alloc(10);
name="mehboob";
this should work all right.