Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command Line args in C program using Netbeans

I am new to usintg Netbeans in Linux. So, I am facing problem how to specify command line args for example A.txt and B.txt for my program in C using Netbeans. Its pretty simple to pass them as args using command line , but now for debugging purpose i need to use Netbeans 7.1 On Ubuntu version 11. Any help would be highly appreciated. Thanks.

like image 230
Basmah Avatar asked Apr 03 '12 15:04

Basmah


People also ask

Can we run C program in NetBeans?

NetBeans C/C support lets you create C and C Application and Library projects with generated makefiles, as well as C and C++ projects with existing sources. You can build, run, and debug your project on the local host (the system from which you started the IDE) or on a remote host running a UNIX® operating system.

What are command line arguments in C?

What are Command Line Arguments in C? Command line arguments are nothing but simply arguments that are specified after the name of the program in the system's command line, and these argument values are passed on to your program during program execution.


1 Answers

Specifying command line arguments seems to have changed since netbeans 6.9 (I just checked). To do this in 7.1, you have to go into Project Properties > Run > Run Command to set the arguments.

For example, to set the arguments -foo -bar, the Run Command setting would read:

"${OUTPUT_PATH}" -foo -bar

like image 70
mnajera Avatar answered Sep 25 '22 01:09

mnajera