### Run Your Application

After you have built an application, you can run it in any of the following ways:

- Create a desktop link for the application, and run it by double-clicking the icon
- Enter the name of the executable file on the command line
- Call the system function from within another application

Pass data to your application
To pass data to your program from the command line, type the arguments after the program name. Arguments must be separated by one or more spaces or tab characters. Arguments that include spaces, tabs, double quotation marks or redirection characters must be enclosed in double quotation marks. For example, this command invokes the program hello.exe and passes it the parameters 42, de f, and 16:

    hello 42 "de f" 16

To use a backslash as part of an argument, precede it with another backslash. For example, this command invokes hello.exe and passes the parameters ABC" and "HELLO\ :

    hello "ABC\"" \"HELLO\\

If your application did not run as you expected

- Make sure the operating system can find your executable file. The operating system searches the file system in the following order:

> 1. Only in the directory specified, if a fully qualified path name is given.
> 2. In the current directory.
> 3. In each of the directories specified by the PATH environment variable. If more than one directory in your PATH has a file with the given name, the operating system runs the first executable file it finds.

- Make sure the operating system can find all the necessary DLLs and message files.

> All DLLs used by your program, including run-time messages files, such as CPPRRT36.DLL, for the IBM C and C++ Compilers run time, must also be either in your current working directory or in one of the directories specified by the NLSPATH environment variable.

> All DLLs used by your program must also be in one of the directories specified by the LIBPATH environment variable. The run-time messages file, CPPRRT36.MSG, must also be either in your current working directory or in one of the directories specified by the DPATH environment variable, unless you have bound the messages to your executable file using the MSGBIND utility.

- If you have made any recent changes to your code, make sure you have rebuilt your application before running it.

Application Run-Time Environment Variables

Redirect Standard Streams
Receive Data as Arguments of main
Get the Return Value from an Application
Invoke the Debugger