How do you write a program using command line arguments?

Answer:
#include<stdio.h>
int main( int argc, char *argv[])
{

FILE *p;
if(!argv[1])
{
printf("can't open the file");
}
else
p=fopen("venki.txt","r" );


return 0;
}
First answer by ID2088516663. Last edit by Venkateshalluri. Contributor trust: 0 [recommend contributor recommended]. Question popularity: 3 [recommend question].