Write a program to "fold" long input lines into two or more shorter lines after the last non-blank character that occurs before the n -th column of input. Make sure your program does something intelligent with very long lines, and if there are no blanks or tabs before the specified column.
1. Is it better (practical?) to store a line into array and then work with it, or just go with while((c=getchar())!=EOF) ? Why?
2. What would be an intelligent thing to do with very long lines / and if there are no blanks before the nth column?
3. Example... input like:
Should i ignore the blanks in between the 2 words, and put a \n right before testing2 word?Code:#define LINE_WIDTH 10 char a[40] = "testing testing2"; Fold_line(a);