Error C2440 in visual studio.

Hello, Im updating some old code and cant find how to get around this error on compile.

error C2440: 'initializing' : cannot convert from 'const char *' to 'char *'

1
2
3
4
5
6
7
8
9
10
{
unsigned char * ss = reinterpret_cast<unsigned char*>(strchr(reinterpret_cast<const char*>(valid_letters), pszOutText[curpos - 1]));
                if ( ss != NULL || pszOutText[curpos - 1] == 39 )
                  {
                if ( curpos < 2 || pszOutText[curpos - 2] != 77 || pszOutText[curpos - 1] != 99 )
                   {
                    chCurrent = locase( chCurrent );
                      }
                        }
                    }



This is the old way of doing it but how can this be re-written to work with VS 2013?

Thank you.
Last edited on
closed account (N36fSL3A)
Why not just do:
unsigned char * ss = (unsigned char*)(strchr((const char*)valid_letters), pszOutText[curpos - 1]));
Last edited on
Can you show the declaration of valid_letters?

That cast seems excessive.
Topic archived. No new replies allowed.