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
1 2 3 4 5 6 7 8 | #include<stdio.h> int main(int argc, char *argv[]) { char *ptr = argv[0]; printf("\nName of the Source Code File:\t%s\n", ptr); return 0; } |
Output

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.