Recall that a text file is just a sequence of bytes on disk
Solution
1) Text file format is less secure than other format like bmp,jpg etc because text file format does not contain any headers.They are just the plain text file with no file structure in it like bmp, jpg etc have .
For example : like bmp have fixed file format stucture or headers, their is specific work and size of these headers.
Name of few header in bmp file are:Extra bit masks, Bitmap file header, DIB header , Color table.... etc .
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
2).
#include<stdio.h>
#include<stdlib.h>
typedef struct{
char password[8];
}FILEHEADER;
int main (int args,char * argv[])
{ FILE *f1,*f2;
int i;
char *temp ,*ch;
f1 = fopen(argv[1],\"r\");
f2 = fopen(argv[2],\"w\");
i=fseek(f1,8,SEEK_SET);
if ( i ==0)
printf(\"pointer sucessfull placed\");
printf(\"%d\",args);
while (1)
{ ch=(char*)malloc(80*sizeof(char));
temp =fgets(ch,80,f1);
if(temp==NULL)
break;
fputs(ch,f2);
free(ch);
}
free(ch);
return 0;
}
