given below is just a program to fetch data from a file
with datat:
“she sells sea shells on the sea shore”
the problem is i need to fetch the characters from the sentence
one by on in a manner that each char is fetched only once :
#include
#include
#include
#include
int main()
{
int fd,i,j;
char ch;
int ma[100];
fd=open(“file.txt”,O_RDONLY);
for(i=0;i<=37;i++)
{
read(fd,&ch,1);
ma[i]=ch;
}
for(j=0;j<37;j++)
printf("%d %c\n",ma[j],ma[j]);
return 0;
}
can anyone help