Hi, when i call this funcion: char *res =(char*) bsearch(ssid, ptr, 9704447, 17, comparator); i use a comparator function.

comparator():
Qt Code:
  1. int comparator(const void *a, const void *b)
  2. {
  3. qDebug()<<"comparator()";
  4. const char *aa = (const char *)a, *bb = (const char *)b;
  5. qDebug()<<"1";
  6. for (int i = 0; i < 6; ++i) {
  7. qDebug()<<"2";
  8. qDebug()<<"i:"<<i;
  9. qDebug()<<"i:"<<i<<" aa:"<<aa[i]<<" bb:"<<bb[i];
  10. qDebug()<<"3";
  11. if (aa[i] != bb[i]) {
  12. return aa[i] - bb[i];
  13. }
  14. }
  15. return 0;
  16. }
To copy to clipboard, switch view to plain text mode 

My aplication crash, it is the debug:

Executable file: 9058 2010-10-25T01:46:47 C:\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb \meoKeyMap.exe
Package: 9380 2010-10-25T01:46:50 C:\Users\Ze\Documents\Qt\meoKeyMap\meoKeyMap.sis
Deploying application to 'Nokia E51 USB (COM4)'...
Copying installation file...
Installing application...
Starting application...
Application running with pid 875.

[Qt Message] comparator()
Process 875, thread 876 stopped at 0x7b95028c: A data abort exception has occurred.
[Qt Message] 1
[Qt Message] 2
[Qt Message] i: 0
Finished.