strcmp in pointer

Joined
Jul 2, 2011
Messages
1
Reaction score
0
Can anyone help me how to compare the two pointer??? the one i mark red


void search(mysummon *s)
{
system("cls");
mycar *p;
float tp;
char *tmp;
tmp = "";
p = s->record;
printf("Enter Car Reg No. :");
gets(tmp);

while(p != NULL){
if(strcmp(p->reg_no, tmp)==0){
printf("\nRecord details:-");
printf("\nCar Registration No : %s", p->reg_no);
printf("\nCar Type : %s", p->car_type);
//printf("\nDate of Summon : %d %d %d", p->date->day, p->date->month, p->date->year);
printf("\nSummon Type : %s", p->summ_type);
printf("\nSummon (RM) : %2.f", p->summon);
printf("\nCompound <Press Y for YES> : %c", p->comp_status);
printf("\Compound Rate (Percentage) :", p->rate);
tp = p->summon * p->rate / 100;
p->final = p->summon - tp;
printf("\nTotal Summon(RM) : %.2f", p->final);
printf("\n--------------------------------");
printf("\n\n");
}

p = p->next;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top