Passing Command-Line Arguments to Programs in Bloodshed Dev-C++


Dr. J (Juliano@csuChico.edu)
Department of Computer Science
California State University, Chico
Chico, CA 95929-0410

February 22, 2005


This document explains how to pass command-line arguments to C programs being developed in the Bloodshed Dev-C++ integrated development environment (IDE). Although command-line arguments may be easily passed to console-based programs executed on a (DOS) shell window, this document describes how arguments may be passed via the Bloodshed Dev-C++ IDE.


  1. These instructions are based on the example illustrated by the figure below. (The file myprog.cpp is available online at http://www.ecst.csuchico.edu/~juliano/eece135/Lab/Dev-C++/CommandLineArgs/myprog.cpp.)



  1. To pass command-line arguments to a program, click on Execute and select Parameters ...



  1. A Parameters dialog box will appear (see below). Enter all command-line arguments to pass to your program in the upper text box and then click the “Ok” button.



  1. Each time you Run your program, the parameters you specified will be passed as command-line arguments to your program.


This document is also available in PDF .