[Solved]Program exited with code 0
-
- As I can see your output doesn't contain any NULL-value. So, I think you have errors somewere else... Possibly, in SQL-table (e.g. wrong field type).
- For what are you make such assignments:
@
...
stmt1temp=stmt1;
cout<<"stmt1temp\n"<<stmt1<<endl;
stmt1=stmt1temp;
...
@
? -
For eg if i am entering the answer like this.
Android is a |Linux-based operating system\ designed primarily for touchscreen mobile devices.In the following code,
@
index = parseOption(index,((Short *)object)->options[i],stmt1,phrase);
cout<<"index : "<<index<<"\n"<<stmt1<<"\n"<<phrase<<endl;
@
The stmt1temp,stmt1 is considered as Android is a
As you know, the phrasetemp,phrase is the same Linux-based operating system
By the following code,@
stmt1=parseQuestion(stmt1); // function called for replacing tilde,cape symbol to angluar brackets
cout<<"stmt1--\n"<<stmt1<<endl;
stmt2temp=parseStepNo(stmt1,i,aPNo);
cout<<"stmt2temp\n"<<stmt2temp<<endl;
cout<<"\nThis is the apno value required"<<aPNo<<endl;
stmt2=stmt2temp;
cout<<"This is STatement2 value"<<stmt2<<endl;
@The stmt1 is taken for stmt2 i.e designed primarily for touchscreen mobile devices.
The assignments are mainly made for parsing the options. -
Actually i missed some thing in the previous post
index : 40
Qt is a
cross platform appln frameworkstmt1temp
Qt is a
stmt1
Qt is a
phrasetemp
cross platform appln framework
phrase
cross platform appln frameworkAfter this
text11insert into ShAnsPts(Statement1,Statement2,Option1,QNo,PointNo,CorrectNo) values ("Qt is a ", NULL,"cross platform appln framework",4816,4816,1)Then,
index : 41
Qt is a
cross platform appln framework
stmt1temp
.
stmt1
.
phrasetemp
cross platform appln framework
phrase
cross platform appln framework -
Also exactly not like that. As assigning the null values in the code for stmt1 and option it will take null values in the out put i.e when printing the output as Qt is a |cross platform appln framework.
In the above result
after printing the stmt1 Qt is a after this null value is seen. -
Instead of returning index value as -1
@
return -1;
@I returned the index itself
@
return (index);
@
Also in the case SHORT:
Instead of checking the condition for executing query for inserting into answer table,@
if(index=-1)
@I checked the condition,
@
if((((Short *)object)->options[i])[index]!='\0')
@
Now it is working fine and all the questions and answers are entering to the main xml file also to the database in the appropriate table.Thanks Lukas Geyer and thanks a lot Aleksey Okinchitc.