if-else statement condition
Hi, i got problem with my coding
i'm using structure array because of the question of my assignment.
So i have testing for many hour already and i'm still stuck.
I want the code just printing the list[0] and list[1] index but it's still printing the list[3] index also, i have found the problem which is my if-else condition does not work..it is still compile but it does'nt work
Code:
printf("\n--Current Student Information--\n");
for(int i = 0;i<4;i++){
if(list[i].name != NULL){
printf("\nPrintName: %s\nPrintAge: %d\n",list[i].name,list[i].age);
*numOfCus = *numOfStu + 1;
}else
return(*numOfStu);
}
Please sharing your experience..Thank you so much