how to enlarge the length of a char string and...
Posted on 2001-06-20
help? the question:
char * a="12345678";
we know the length of a is 8.now i want to enlarge the length of a but the address of a doesn't change.for example after i enlarge the *a's length,the *a may be "123456789",we konw that the system malloc the a and the *(a+8)='\0',when i make *(a+8)='9' ;*(a+9)='\0',the error MAY occupy because the address a+9 may be private or i cannot access (write) .
how to solve the problem.