c_str is already a char*, so that part is moot and can be pulled
you mixed c and c++ casts, a little odd, but removal of the char* part will only have one cast (the C style one..). I have no problem with c-style casts because the c++ ones are clunky, but most pros would say to prefer the c++ casting.
Actually, it's constchar * so the const_cast may be necessary to go const char * -> char * ->unsigned char *. To avoid the complication, I think I'd just do (SQLCHAR *)parameterString.c_str()
/****************************
* standard SQL* data types. use these as much as possible when using ODBC calls/vars
***************************/
typedefunsignedchar SQLCHAR;
Worked fine! Thank You! I did not like to cast a const variable to an not const...
salem c:
Thank your for the link, but I am working with MSSQL not MYSQL. And Because I have the work instruction to do it this way for learning purposes. Understanding lagacy c++ code, that does not have any wrappers need to understand the topic... so I try to understand and "revive" my c++ knowledge. I did not code c++ for more than 10 Years...
10 years misses 2 major revisions to the language; c++11 and c++17 features both of which are good to know. If you have time, you will want to review these. I was in the same situation a few years ago, slowly catching up. I am sure that whatever you are using has a modern version but if you need to learn the legacy, that isn't useful info.