I ran the following tests on my linux box.
test 1:
printf("test %s\n", NULL);
printf("test %s\n", NULL);
prints:
test (null)
test (null)
test 2:
printf("%s\n", NULL);
printf("%s\n", NULL);
prints
Segmentation fault (core dumped)
What is the difference in the above tests? Why is segmentation fault not thrown in test 1 above?
I was not able to understand why in the second test, it is failing to print?