No, you must provide an actual char array or a c++ string to store the input. Right now, the constant MAX is serving two purposes: one is to set the size of the input buffer buff, and the other is to control the length of your output lines.
But if you want to prompt the user for the output line length, just define another int variable for that purpose (DON'T name it line_length since you're already using that name in the editing loop), and edit the code that controls output line length:
Code:
...
if( line_length > MAX ) { // edit this line -- replace MAX with your new variable
...
buff must be either a c++ string or a char array with a constant size, and that size must be big enough to fit the longest word.