Use code tags to post code here. That preserves your code's formatting and keeps it readable.
char *convert(char *a)
array = 't'
array = 's'
array = 'e'
array = 't'
array = '\0'
array is outside the bounds of the 5-element array and so "does not exist", but in reality by writing to this location you are clobbering (overwriting) whatever other data or function control value is stored there. The Thing and The Hulk can clobber, but you must not. Therefore, array='\0';
is just plain wrong and must be corrected. But that's not the problem you wrote to us about.
is clumsy and stylistically would be better rendered as
Actually, that a index would in a general solution be [strlen(a)=i]; in this case strlen(a) would be 4. The for-loop should also iterate for strlen(a) -- personally, I would have assigned that function's return value to a variable for reuse.
But that's not the problem that you wrote to us about.
Look at that for-loop. I tried to bold the semicolon at the end, but you still might not see it. What you are telling the compiler is that there is block of code attached to this for-statement, so it loops 5 times doing notion except to iterate the value of i, then, since i == 5, it clobbers whatever is there with whatever comes right before the array a (ie, what's at a[-1]) and moves on. As a result, the array you return is filled with garbage, since you've never actually written to it.
Getting rid of that semicolon should clear up the problem you wrote to us about, but you have some other problems to clean up as well.