Saturday, October 19, 2013

Print All values passed by commandline arguments in C

Program:

//disp.c
#include<stdio.h>         //print all values passed by commandline arguments
#include<conio.h>         //TESTED
int main(int args,char *argv[])
{
for(int i=0;i<args;i++)
printf("\n%s",argv[i]);
getch();
return 0;
}

Output:

disp.c Hai hello

Hai
hello 

No comments: