Click here to Skip to main content
15,894,907 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C
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;
        }
}
Posted
Updated 24-Jun-10 20:30pm
v2
Comments
Ankur\m/ 25-Jun-10 2:30am    
You forgot to mention the PROBLEM!
Sandeep Mewara 25-Jun-10 2:35am    
1. Don't use text speaks like plz.
2. What is the problem ? Error?

1 solution

As you haven't asked a question I wouldn't have normally bothered answering. However one thing sticks out like a sore thumb.

If you're going to use a #define in a declaration then make sure it's defined before you use it.

Cheers,

Ash

PS: You're using a lot of globals you haven't included in the sample above which makes it hard to follow. As well as hard to maintain for the poor mug that comes after you.
 
Share this answer
 
Comments
CPallini 25-Jun-10 6:03am    
I didnt giv the full code....however the problem has been solved.....

it was with the global variable and its space allocation... which created the linking prob during compilation
-- Joydeepsarkar [moved from 'fake' answer]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900