Exercise 1-22 from K and R: line folding
Potential Buffer Overflows

You've defined from and to to hold only 10 characters apiece, but none of the code actually enforces that, and it appears that you plan on them holding 80 characters or so. You should probably pass the array size to getline, for example, so that it can stop reading either when it reaches a new-line or when it runs out of space in the destination buffer.

Formatting

Your indentation is inconsistent and in places seems rather excessive.

Variable names

Many of your variable names could use some work. Names like a, b and max (that doesn't seem to hold a maximum) could be replaced with much more meaningful names.

Inefficiency

Depending on your viewpoint, there's a fair argument to be made that your code is less efficient than there's any real need for. In particular, it works by reading data into one buffer, then copying all that data to another buffer.

I'd consider a strategy something on this general order:


Read in a line
If it's shorter than the maximum, print it out and go back to 1
Starting from line[max_width], search backward in the string to find a space.
Change that space to a new-line.
Repeat from 2, using the string following the newline you just inserted.