EmbLogic's Blog

To print master array

#include<stdio.h>
#include<string.h>
#include<fcntl.h>
int main()
{
int i,j,fd,len,maslen=1;
char arr[100]={0};
char masterarr[25]={0};
fd=open(“add.c”,O_RDONLY);
i=0;
while(read(fd,&arr[i],1))
i++;
len=strlen(arr);
for(i=0;i<len;i++)
{
for(j=0;j<maslen;j++)
{
if(j+1==maslen)
{
masterarr[j]=arr[i];
maslen++;
break;
}

else
{
if(masterarr[j]==arr[i])
break;

}

}

}
printf(“masterarr=%s\n”,masterarr);
return 0;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>