For some reason, my fprintf statement does nothing. I put printf statements around it to see if it even gets to it (which it does), but I still can't figure out why nothing happens. Here is my code:
#include <stdio.h>
int main(int argc, char *argv[])
{
char c[8];
FILE *fp;
FILE *fp2;
int i=0;
int count,j,temp=0;
fp = fopen(argv[0],"r");
fp2 = fopen(argv[1], "w");
for(i=0; i<50;i++)
{
count = fread(c,1,8,fp);
if(((4<i)&&(i<10))||((14<i)&&(i<20))||((24<i)&&(i<30))||((34<i)&&(i<40))||(44<i)){
continue;
}
else{
for(j = 0; j<count; j++){
c[j]=c[j]-'0';
c[j]=c[j] << (count - (j+1));
temp = temp | c[j];
}
fprintf(fp2, "%dn", temp);
}
}
fclose(fp);
fclose(fp2);
retu 0;
}
I've tried multiple things but can't figure it out!
Thanks!.
