/*A program to tell what could be argument of main..?*/
#include<stdio.h>
#include<fcntl.h>
#include<unistd.h>
int main(int argc,char* argv[])//int arc bcz it is of int type will have count of number of command line argunets ...either it is passed from command line directly or passed by applying command on script ...actually 1st argument is always is the name of the file ...& 2nd argument is what we have given after name of file on command line argument ....
//char* argv[] is nothing but a pointer of array...somthing like //char* anu[]={"RED,WHITE,VOILET,GREEN"};
//*anu will be base address of this array...when we talk about pointer we may say that we r moving R to W to V..
//when i say array means i will move frm R to E to D || W to H to I to T to E...SO ON.........
//char* argv[] will not check either that word is normal word or filename
{
int fd,j=0;
char buff[10]={"\ni am anu"};
fd=open(argv[1],O_WRONLY);//I had opened the file using system call open in writeonly mode by passing argument 1 means not executing filename[arg=0]...but other filename which is going to be used in this program
while(j<10)
{
write(fd,buff+j,1);//using write system call...data from buffer one by one written into fd..