>Am I missing something.
Yes. iDeveloper gave you the fix, but the reason for it is that you're initializing pointers to string literals. The problem isn't the pointers per se, it's the initialization of a pointer to a string literal. A string literal in C++ is defined as an array of const char, and strtok modifies the first argument by writing null characters at each delimiter. The access violation comes from strtok trying to write to read-only memory.
By changing style from a pointer to an array, the initialization changes as well. Instead of assigning the address of the string literal to a pointer, you're copying the contents of the string literal to a non-const array that you own and can modify.
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Offline 11,807 posts
since Sep 2004