i need my program to read in a file reverse it then write the file out.
i got the reverse correct but its not working.my errors are:
n.c:12: warning: passing argument 1 of 'fopen' from incompatible pointer type
n.c:21: warning: passing argument 1 of 'fopen' from incompatible pointer type
n.c:22: warning: passing argument 1 of 'fputs' from incompatible pointer type
n.c:22: error: too few arguments to function 'fputs'
#include <stdio.h>
#include <string.h>
#include <ctype.h>
int main() {
char string[256];
char*filename[256];
char*outfilen[256];
char c;
int len;
FILE * infile=0;
FILE * outfile;
infile=fopen(filename,"r");
fgets(string, sizeof string, stdin);
len = (strlen(string) - 1);
printf("Reverse string:\n");
for(; len >= 0; len--)
printf("%c",string[len]);
printf("\n");
outfile=fopen(outfilen,"w");
fputs(outfile);
fclose(infile);
fclose(outfile);
}