Learn How To Find The Source File Name of the C Program and Print it in C Programming. To print the source file name, you need to use Pointers and Command Line Arguments in C Programming.
Must Read: C Program To Print Map of India
C Program To Find Source Code Object File Name
int main(int argc, char *argv)
char *ptr = argv;
printf("\nName of the Source Code File:\t%s\n", ptr);
If you have any compilation errors or doubts in this C Program To Find and Print Source Code File Name using Pointers, let us know about it in the comment section below.