Subj : Local character strings To : borland.public.cpp.borlandcpp From : Ray Sittig Date : Thu Sep 22 2005 06:36 pm I thought when a function is called, local variables go on the stack and are re-initialized on each call. That doesn't seem to be happening for character strings as shown in the following short program. Comments/insight appreciated. Borland C++ 5.02. Thanks, Ray >>>> snip >>>> #include #include void main(void); void PrintText(int version); void main() { PrintText(2); PrintText(1); PrintText(2); printf( "\nPlease press '1' to continue.\n"); while (true) { if (getche() == '1') break; } } void PrintText(int version) { char* MyText[4] = {"2 Line Version: Line 1", "2 Line Version: Line 2"}; int number_of_lines_to_print; if (version == 1) { number_of_lines_to_print = 1; // once changed - changed for all subsequent calls // therefore MyText not re-initialized MyText[0][0] = '1'; } else number_of_lines_to_print = 2; printf("Version %d\n", version); for (int i = 0; i < number_of_lines_to_print; i++) printf("%s\n", MyText[i]); printf("\n"); } .