Monday, 3 November 2014

Basic c program in UNIX and DOS when argv value is '*'

#include<stdio.h>
main(argc,argv)
int argc;
char *argv[];
{
int i;
for(i=0;i<argc;i++)
printf("Argument is %s\n",argv[i]);
}

Check wheather C/C++ is installed and environment variable is on
>tcc filename.c
>filename

In UNIX
>gcc filename.c -o compiledfilename.out
>./compiledfilename.out

In Unix it lists all directories
In DOS it gives *

No comments:

Post a Comment