- 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;
}
}
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;
}
}