Program name: Difference between revisions

m
m (→‎{{header|Phix}}: full -> full/name/base)
m (→‎{{header|C++}}: Reworded)
Line 469:
 
=={{header|C++}}==
C++ has difficulty accessing source code filenames, because C code must be compiled into an executable. However, C++ can access the executable's filename through the arguments to main().
 
<lang cpp>#include <iostream>
Line 478:
char *program = argv[0];
cout << "Program: " << program << endl;
 
return 0;
}</lang>
 
125

edits