I am reading characters using structures and pointers, i am not allowed to use string. I need to use something like this code below, that wraps the text in case the word is not finished, i don't know how to use this code without strings.Could someone please help?
Thank you for your time.
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
int main () {
int i;
char s[] = "This is only a test for wrapping lines";
printf("%s\n", s);
i = 20; // our wrap point
while(i!=0) {
if (isspace(s[i])) {
s[i] = '\n';
break;
}
i--;
}
printf("\n%s\n", s);
return 0;
}