reading characters using structures and pointers

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.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#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;

}
Topic archived. No new replies allowed.