summaryrefslogtreecommitdiff
path: root/reference/C/EXAMPLES/prog_name.c
blob: fcf18c94eb107404f38eaed42bf8ed1fccf98cbd (plain)
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);
}