Program name: Difference between revisions
Content added Content deleted
m (→{{header|Phix}}: full -> full/name/base) |
m (→{{header|C++}}: Reworded) |
||
Line 469: | Line 469: | ||
=={{header|C++}}== |
=={{header|C++}}== |
||
C++ can access the executable's filename through the arguments to main(). |
|||
<lang cpp>#include <iostream> |
<lang cpp>#include <iostream> |
||
Line 478: | Line 478: | ||
char *program = argv[0]; |
char *program = argv[0]; |
||
cout << "Program: " << program << endl; |
cout << "Program: " << program << endl; |
||
return 0; |
|||
}</lang> |
}</lang> |
||