Click here to Skip to main content
15,889,281 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: wrong output ,error in my program Pin
mk1488211-Aug-10 3:19
mk1488211-Aug-10 3:19 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 3:30
0x808511-Aug-10 3:30 
AnswerRe: wrong output ,error in my program Pin
Maximilien11-Aug-10 3:26
Maximilien11-Aug-10 3:26 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 3:41
0x808511-Aug-10 3:41 
GeneralRe: wrong output ,error in my program Pin
mk1488211-Aug-10 4:24
mk1488211-Aug-10 4:24 
GeneralRe: wrong output ,error in my program Pin
0x808511-Aug-10 4:30
0x808511-Aug-10 4:30 
AnswerRe: wrong output ,error in my program Pin
elchupathingy11-Aug-10 3:41
elchupathingy11-Aug-10 3:41 
QuestionProblem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 0:21
T.RATHA KRISHNAN11-Aug-10 0:21 
Hi!
I've to read Player Names from a data base table. I'm randomly selecting 11 players from each country(totally nine countries). I'm using the following code to do this:

array<stringc> ctyLst = SQLdb.Query("Select DISTINCT Team from Test ORDER BY Team DESC");
core::stringc queryStr;
for(int i = 0; i<ctyLst.size();i++)
{
queryStr = L"Select Name From Test WHERE Team ='";
queryStr += ctyLst[i].trim();
queryStr += L"'";
queryStr += L"ORDER BY RANDOM() LIMIT 11";
playerLst = SQLdb.Query(queryStr);
//playerLst.push_back(SQLdb.Query(queryStr));
printf("%s \n",queryStr.c_str()); 
printf("%s \n",playerLst[i].c_str());
}


The first 4 lines inside the For loop builds the query dynamically. At line 5, the query is executed and the result is assigned to the array. When I print the elements of playerLst array only 11 player names are printed(not what I expect. It has to print 99 names since each country has 11 players and there are 9 cty's). If I uncomment the line 6(i.e push_back()), the following error occurs:

Error 2 error C2664: 'irr::core::array<T>::push_back' : cannot convert parameter 1 from 'irr::core::array<T>' to 'const irr::core::stringc &' d:\test\main.cpp 142

How to initialise the array with the query result and print it completely?
AnswerRe: Problem with String Array Pin
CPallini11-Aug-10 0:36
mveCPallini11-Aug-10 0:36 
GeneralRe: Problem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 0:46
T.RATHA KRISHNAN11-Aug-10 0:46 
GeneralRe: Problem with String Array Pin
CPallini11-Aug-10 1:18
mveCPallini11-Aug-10 1:18 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 0:54
Nuri Ismail11-Aug-10 0:54 
GeneralRe: Problem with String Array Pin
CPallini11-Aug-10 1:17
mveCPallini11-Aug-10 1:17 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 1:44
Nuri Ismail11-Aug-10 1:44 
AnswerRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 0:51
Nuri Ismail11-Aug-10 0:51 
GeneralRe: Problem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 0:59
T.RATHA KRISHNAN11-Aug-10 0:59 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 1:04
Nuri Ismail11-Aug-10 1:04 
GeneralRe: Problem with String Array Pin
T.RATHA KRISHNAN11-Aug-10 1:19
T.RATHA KRISHNAN11-Aug-10 1:19 
GeneralRe: Problem with String Array Pin
Nuri Ismail11-Aug-10 1:42
Nuri Ismail11-Aug-10 1:42 
GeneralRe: Problem with String Array[Solved] Pin
T.RATHA KRISHNAN11-Aug-10 1:54
T.RATHA KRISHNAN11-Aug-10 1:54 
GeneralRe: Problem with String Array[Solved] Pin
Nuri Ismail11-Aug-10 2:51
Nuri Ismail11-Aug-10 2:51 
QuestionUnRegisterHotKey problem Pin
wikywin10-Aug-10 22:21
wikywin10-Aug-10 22:21 
AnswerRe: UnRegisterHotKey problem Pin
Niklas L10-Aug-10 22:46
Niklas L10-Aug-10 22:46 
GeneralRe: UnRegisterHotKey problem Pin
wikywin10-Aug-10 22:57
wikywin10-Aug-10 22:57 
GeneralRe: UnRegisterHotKey problem Pin
Niklas L10-Aug-10 23:07
Niklas L10-Aug-10 23:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.