hi, sorry for my english. i added some comment on your code..
Code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#define THESIZE 10
void resize_myarray (char *arr, unsigned int new_size );
//char *myarray;
main (int ac, char *av[]) { //NOT char**av[]
char *myarray; //NO global variables NO
myarray = malloc(THESIZE * sizeof(char));
//you can store max THESIZE-1 char because there is a \n at the end if the string.
strncpy(myarray, "012345678", THESIZE * sizeof(char));
printf("%d\n", (int)strlen(myarray)); //need cast to int
free(myarray);
resize_myarray(myarray, THESIZE * 2 * sizeof(char));
//same problem...you can store THESIZE * 2 - 1 char
strncpy(myarray, "0123456789012345678", (THESIZE * 2 * sizeof(char)));
printf("%d\n", (int)strlen(myarray)); //need cast to int
exit(0);
}
void resize_myarray (char *arr, unsigned int new_size ) {
arr = realloc( NULL, new_size );
}