showDescription(); Function Improvement

#1 · open · 0 comments

View on GitHub ↗

ZeroPyrozen

## Description A void function need logic improvement. This function is needed to display a paragraph of book description. Currently it looks something like this: ``` void showDescription(char temp[]) { int length, i; length = strlen(temp); for (i = 0; i < length; i++) { if (i == 0) printf("\t\t%c", temp[i]); else if (i % 10 == 0) { if(isspace(temp[i])) printf("\n%c", temp[i]); else printf("%c", temp[i]); } else printf("%c",temp[i]); } } ``` I need to make it looks more like paragraph with 7 indentation, 100 chars maximum, and justified. ## What you can do? You can remake or edit the function and show the preview to me. Thank you for your attention.

Comments