best practice when referring to a program's name in C
- by guest
what is considered best practice when referring to a program's name? i've seen
#define PROGRAM_NAME "myprog"
printf("this is %s\n", PROGRAM_NAME);
as well as
printf("this is %s\n", argv[0]);
i know, that the second approach will give me ./myprog rather than myprog when the program is not called from $PATH and that the first approach will guarantee consistence regarding the program's name.
but is there anything else, that makes one approach superior to the other?