this part is because after the "up" there is no space
check for "\0"
we store a new word "up" in b[2][0]... or second row of
b[10x20] array.
here wrd=2 and i=0,1,2.. that is 0=u, 1=p, 2='\0'
i=0;
if(a[x] == '\0')
for(p=m;p <= x;p++)
b[wrd][i++] = a[p];
b[wrd][i] = '\0';
here b[j] is just that i = wrd and j is the stings
jack
went
up
where b[2][0] = u
b[1][0] = w
b[0][0] = j
for(i=wrd; i >= 0 ; i--) {
int j = 0;
while( b[i][j] != '\0')
cout << b[i][j++];
cout << endl;
}
hope you get the idea. just throw in some cout statments in the
code and print b[j] you will get it.