(SOLVED)Can any one help?

Yes i can see that is the problem now but the way that am understanding it is that is that a string of 1234567891234567> the last 7 is placed into the 15th element then incremented to the 16th element (NULL is placed into that) and then the if stament of if(i == 16) should exit the loop and byte i goes back to 0 when the functhion is called again so at the min i can't see that "i" gets to the 17th. Hope you understand me. My understanding must be wrong.