Before I used something like this:

Say theString is a QString w.

And I had this line of code:

for(i=0; theString[i]!=QChar('\0'); i++)
{
if(theString[i]==QChar('('))
{
... ...
}
}

I ran the debug and found that altough i keeps on increasing from 0 to 1 to 2 and so on,

The array under "theString" has only one entry "[0]" whose value is "46".

I don't know how that happened, can someone help me?

Also, I remember checked somewhere saying that if you transform a C styled string into

QString, the QString won't be terminated by '\0'. I am concerning if my case is under this condition:

My "theString" has gone through several transformations:

First it is a QString, then it is strcpy ed to a char array, then this char array was passed as a parameter of function a, and the parameter requires a char*. After that, it is transferred from function a to function b, still as a parameter, but this time the parameter requires a QString. And then it is in function b that I want to convert this QString to QChar array.

Without converting to QChar array, this QString seemed to work fine.

Thanks