T
tmartsum
try
const char *table1 = "something"
const char table2[] = "something"
and then try
char * x = const_cast<char*>(table_x);
x[0] = 'y';
my guess is that it crahses on table1 but not on table 2.
(But it depends on compiler, but the compiler are allow to put the
first into the codesegment (even if not const) - that means that it is
totally protected from being modified.)
const char *table1 = "something"
const char table2[] = "something"
and then try
char * x = const_cast<char*>(table_x);
x[0] = 'y';
my guess is that it crahses on table1 but not on table 2.
(But it depends on compiler, but the compiler are allow to put the
first into the codesegment (even if not const) - that means that it is
totally protected from being modified.)