You cannot cast a variable from one type to another if the two types are incompatible! You didn' understand the comments in
your other posting, did you?
Again:
Do not use type casts! If you have incompatible types (such as a string type and an integral type), you
must use special conversion functions! If you have types that should be compatible but still issue compiler warnings, then in 101 out of 100 cases the type of one or both variables hasn't been chosen appropriately - in that case, fix the variable types!
There are very, very, very, very, very, very few occasions where type casts are actually required, and they involve either some obscure low-level stuff best left to the gurus, or interaction with some badly designed interfaces from the stone age (such as the MFC). If neither is the case for you, assume that any perceived neccessity for a type cast is a misperception, and in truth your code needs reworking!
I don't know what the types SQLINTEGER and SQLCHAR are defined to be, but if they are compatible to
int
and
char
respectively, then a simple call to the function
atoi(const char*)
should work just fine.