1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
/************************************************************************
*
* Purpose: Display the name of the program.
* To do: Stip any directory information away so we are left with
* with the file name only.
* Author: M.J.Leslie
* Date: 09-Jan-95
*
************************************************************************/
main(int argc, char *argv[])
{
char *prog=argv[0];
/* prog_name points to the same location
* as argv[0]
*/
printf("Program is called %s\n", prog);
}
|