atoi Not Compatible

I have an if statement with two SQL types that I am comparing with each other
The statement....

if (rowCount3 >= chval1)

rowCount3 is an SQLINTEGER
chval1 is an SQLCHAR chval1[128]

I tried
if ((SQLCHAR)rowCount3 >+ (SQLCHAR)chval1)

It works some of the time...I need it to work all of the time. Someone suggested strcmp but I am clueless even after googling, any help is appreciated. Thank you.
PS I think I have to convert chval1 into an integer. How can I do that?
Last edited on
Tried this and got SQLCHAR* is not comaptible with typeparameter const char*.

1
2
int var = atoi(chval1); 
if  (rowCount3 >= var)

You have declared chval1 as a 128 byte array of chars, and so the symbol chval1 by the syntactic rules of C and C++ resolves to a character pointer to the base address of the memory allocation, not to any specific single byte character entity. If you want to specify some specific char, use chval1[whatever].
Last edited on
Topic archived. No new replies allowed.