Programming with and without Command Line Arguments

Hello Folks !!
I  have received many questions from you all that What is the difference between programming with & without Command Line Argument ??
So Today I will  clear some doubt ....
Make sure that you like our Facebook page here, so that you get notification about our new posts.




While executing some Programs,  the compiler need Inputs. 
These Inputs can be sent to Compiler in many forms :

Scanf: It is a built-in function present in C Library which is used to take input from standard Input. This function insists user to give some value when the compiler executes scanf statements. 

int a;
scanf("%d",&a);

 scanf is Interactive.  Command line arguments are not.

Interactive inputs assume the user is using it in an interactive way (It's quite easy)


Command Line Argument : It is possible to pass the values from the command line itself, while you are executing. The values/Arguments are called as command line arguments. Command line arguments are passed to main() method. Arguments are stored in argument vector (argv).

int main( int argc, char *argv[])

 Command line argument means something passed to the program when calling from the Command Line Interface.

For more Explanation about Command Line Arguments check this out : Command Line Arguments (Explanation)


Execution of  C Program through Command Line Argument can be done on various compilers. It can be done in various ways, some are as follows,

Execution of C Program using Command Line Arguments in Turbo C/C++ . ( click here to see full post )
Sample Screenshot






Execution of C Program using Command Line Arguments in CodeBlocks . ( click here to see full post )

Sample Screenshot





For detailed instructions how to execute, click on to links above. 



Post a Comment

0 Comments