How to convert LPCTSTR to int data type using VC++
I am trying to store the count returned from the SQLite query, the return value is of type LPCTSTR;
How can I convert CPCTSTR value to an int data type.
In the code, the below line has the issue.
int count = results.fieldValue(0);
wstring sql= "select COUNT(*) from table1;CppSQLite3Query results = dasContextdb_.execQuery(sql.c_str());while (! results.eof()){ int count = results.fieldValue(0); // Error coderesults.nextRow();}
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
After my post, I found a way to resolve the issue as mentioned below.
wstring Val = results.fieldValue(0);
count = _wtoi(Val.c_str());