how to split words in astring in c? : I need to build a program that recives up to 30 chars from the user, and then to play with it.
For example, i need to reverses the sentence and then print it, or to rotate it. 
I have been trying to copy the words of the sentence one by one to a matrix of [30][31], but it does not working... any ideas?
and i can not use pointers...
thanks for the help :)


    #include <stdio.h>
    #include <string.h>
    void main(){
	int i=0,j=0,wrongData=0,charCounter=0,word=0,letter=0;
	char st[100],arr[100]={0},mat[30][31]={0};
	printf("Please, enter your sentence >");	
	gets(st);
	while(i<strlen(st)){
			if('A'<=st[i] && st[i]<='Z'){
				charCounter++;
				arr[j] = st[i];
				i++;
				j++;
				}
			else if(st[i]==' '){
				arr[j] = ' ';
				i++;
				j++;
				while(st[i] == ' '){
					i++;
				}
			}
			else if(st[i]=='\0'){
				arr[j] = '\0';
				break;
			}
				else {
						puts("ERROR: Incorrect data, try again.");
						wrongData=1;
						break;
	}
				if(wrongData==0){
					if(charCounter>30){
							puts("ERROR: Incorrect data, try again.");
					}
				}
    }
	puts(st);
	puts(arr);
	if(arr[j]==' '){
	word++;
	}
	while(arr[j]!=' ' && letter<32){
		strcpy(mat[word],arr);
		}
		if(arr[j]=='\0'){
		mat[word][letter]=arr[j];
						}		
	
    puts(mat[word]);
	}