typedef struct { char pDocId[14 + 1]; } sBlocRepSRR; typedef struct { sBlocRepSRR pBlocRepSRR[MAX_REPONSES + 1]; }sRepSRR; void func(sRepSRR * pResponse) { for (i=0; i<icount; i++) { if (pResponse->pBlocRepSRR[k].pDocId_PDF < pResponse->pBlocRepSRR[j].pDocId_PDF) { printf("k is less than j\n"); k = j; } else { printf("k is greater than j\n"); k = k; } } printf("Maximum value is %s\n", pResponse->pBlocRepSRR[k].pDocId_PDF); }
strcmp
int strcmp(const char *string1, const char *string2);
string1
string2
Poonamol wrote:if (pResponse->pBlocRepSRR[k].pDocId_PDF < pResponse->pBlocRepSRR[j].pDocId_PDF)
long lk, lj; lk = atol(pResponse->pBlocRepSRR[k].pDocId_PDF); lj = atol(pResponse->pBlocRepSRR[j].pDocId_PDF); if ( lk < lj )
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)