Adding char to string

While it pains me to ignore the obvious mistake and the likely other mistakes in your snippet I will directly address your question...

a[_length+0]=id;
a[_length+1]='\0';
_length=strlen(a);