> I do no see why it stops. I will be very ppriciated if anyone can point where I am wrong.
> scanf_s("%s", X[i].first_name); //it stops here.
Well you're wrong in that you didn't read the manual for scanf_s before using it.
scanf_s, _scanf_s_l, wscanf_s, _wscanf_s_l (CRT)
%s needs a buffer size, and you're just passing garbage with the non-existant parameter.
And Microsoft was wrong in believing that anyone who used the non-portable and proprietary _s versions of standard library functions would be able to write better code. Especially since they didn't bother to make the compiler diagnose printf/scanf screwups.
scanf_s is no more safe than scanf, if you DON'T read the manual on how to use it properly.