no the way u've done it, it should be newstring[i] = '\0';
but personally this is the way i would do it.
since '\0' character value is 0, the loop will end with that value.
actually i missed something in ur code above, it shouldn't beCode:for(i = 0; array[i]; ++i) newstring[i] = array[i] newstring[i] = '\0';
it should beCode:char *newstring = new char[strlen(array)];
requires the +1 for the '\0' terminatorCode:char *newstring = new char[strlen(array)+1];