this is the program i have right now, this program reads the source file lab2.c and creates a new file called lab2b.c. what i wanna know is if the code in lab2.c is not indented properley how can i write a code to indent lab2.c properley.
Help would be greatley appriciated, e-mail me if you have any questions!!!!!
Code:
#include <stdio.h>
int main()
{
FILE *f,*ff;
char s[100];
f=fopen("lab2.c","r");
fgets(s,1000,f);
ff=fopen("lab2b","w");
while (fgets(s,100,f)!=NULL)
{
printf("%s",s);
}
fprintf(ff,s);
fclose(ff);
fclose(f);
return 0;
}
Code tags added by Hammer