int *nums = {5, 2, 1, 4};
printf(\"%d\\n\", nums[0]);
causes a segfault, whereas
int nums[] = {5, 2, 1, 4};
printf(\"%d\\n\", nums[
int *nums = {5, 2, 1, 4};
nums is a pointer of type int. So you should make this point to some valid memory location. num[0] you are trying to dereference some random memory location and hence the segmentation fault.
Yes the pointer is holding value 5 and you are trying to dereference it which is undefined behavior on your system. (Looks like 5 is not a valid memory location on your system)
Whereas
int nums[] = {1,2,3,4};
is a valid declaration where you are saying nums is an array of type int and memory is allocated based on number of elements passed during initialization.