Hello, i have trouble with creating funkction that will remove white spaces if they are more than 1 in a row
i have created this function so far
void VymazBiele()
{
int c;
while ( (c = getchar() ) != EOF )
{
if (isspace(c))
{
putchar(' ');
while ( (c = getchar() ) != EOF && isspace(c))
{}
}
if (c != EOF)
{
putchar(c);
}
}
}
but i also need remove white spaces at the stard of the line and at the end of the line and this function cant do this
i figured out that i can replace the first and last white spaces with something like this
if isspace(c)
{
putchar('\0')
}
but i dont know how to " ask " on the first char, i can use only standard function like getchar, putchar... and i need to create condtion that will look like this
" putchar('\0') untill you find the first alphabetic character and then use function created above "
can someone help ?