Write a program which converts any tab characters, ’\t’, occurring in an input file called
mytabs.txt, into a sequence of n spaces, where n is read from the keyboard. The resulting
file is written to myspaces.txt. In other words, if mytabs.txt contains
This file has too many tabs.
where each space above is actually a \t character, then the file myspaces.txt should look
like the following if n = 2
This file has too many tabs.
i did this code : but it's not working why?
#include<stdio.h>
#include<stdlib.h>
int main()
{
char d;
FILE * fin =fopen("mytabs.txt", "r");
FILE * fout =fopen("myspaces.txt", "w");
int n;
Comments
Leave a comment