oke till now i have gotten till here
Code:
#include "includes.h"
int main(void)
{
char array[600];
char valid_characters[]="asdfghjklmnbvcxzqwertyuiop";
int count=0;
int i;
int x;
atexit(close_the_file);
atexit(pause);
/*
*First,open the text file for writing
*and write out the header info to it
*/
for(x=0;valid_characters[x]!='\0';x++);
/*{
printf("%c\n",valid_characters[x]);
}*/
fptr=fopen(FNAME,"r");
if(fptr==NULL)
{
fprintf(stderr,"Coudnt not open \n",FNAME);
/*here we test
*if fopen returns NULL
*then there is a problem happened
*we putted them in stderr and say
*couldnt open file name bla coz bla
*happened :P*/
exit(1);
}
printf("The lines are as follows %s",FNAME);
/*
*write the rest of the header info,including current time
*/
for(;fgets(array,sizeof array,fptr)!=NULL;)
{
for(i=0;i<strlen(array);i++)
{
if(array[i]=='@' && array[i]==valid_characters[x])
{
fputs(array,stdout);
}
}
}
return 0;
}