extern char received_msg[BUFFER_SIZE]; extern char voters_id[BUFFER_SIZE]; #define BUFFER_SIZE 100 void compare_votes(void) { char id1[]="v1"; char id2[]="v2"; unsigned int count1=0, count2=0; if(!strcmp(received_msg,id1)) {count1++;} if(!strcmp(received_msg,id2)) {count2++;} } void compare_id(void) { int i; char received =0; for (i=0; i<=voters; i++) { if(v[i].flag==0) { if (!strcmp(voters_id,v[i].voter_ID)) { v[i].flag=1; compare_votes(); received =1; } } if (received==1) break; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)