Questo va bene secondo voi?:
#include <stdio.h>
#include <string.h>
void read_string(char s[], unsigned int dim);
void from_tab_to_space(char s[], char t[]);
void main()
{
int i, j;
char t[25];
char s[50];
read_string(t, 20);
from_tab_to_space(s, t);
printf("%s", s);
}
void read_string(char s[], unsigned int dim)
{
int c;
unsigned int i;
for (i = 0; i < dim - 1 && (c = getchar()) != EOF; ++i)
{
s[i] = c;
}
s[i] = '\0';
}
void from_tab_to_space(char s[], char t[])
{
unsigned int h, i, j, esc = 0;
for (j = i = 0; i < strlen(t); i++) {
if (t[i] == '\t')
for(h = 0; h < 5; h++)
s[j++] = ' ';
else s[j++] = t[i];
}
s[j] = '\0';
}