I'm unable to modify any of the individual elements in String arrays, though the array is not declared 'const' .
Eg.
char * Strings[] = { "sunday",
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday" };
char **pStrings = Strings;
//Each of the following assignments results in runtime Access Violation error.
//with MS Visual C++ 6.0 as well as the .net version.
Strings[3][5] = 'e'; // runtime exception
*(*(pStrings+3)+5) = 'f'; // runtime exception
pStrings[3][5] = 'g'; // runtime exception
//But each of the above assigments can be made in debug mode, after breaking the execution, say using 'Watch Window'
Can anybody throw some light on this STRANGE PROBLEM please?
Eg.
char * Strings[] = { "sunday",
"monday",
"tuesday",
"wednesday",
"thursday",
"friday",
"saturday" };
char **pStrings = Strings;
//Each of the following assignments results in runtime Access Violation error.
//with MS Visual C++ 6.0 as well as the .net version.
Strings[3][5] = 'e'; // runtime exception
*(*(pStrings+3)+5) = 'f'; // runtime exception
pStrings[3][5] = 'g'; // runtime exception
//But each of the above assigments can be made in debug mode, after breaking the execution, say using 'Watch Window'
Can anybody throw some light on this STRANGE PROBLEM please?