i have to count three districts 1, 2, 3 whom said no and whom said yes, which i had saved it in notepad the three districts. i have to use the while loop.

i was trying

ifstream iFile;

inFile.open("vote.dat")

while(district1 == yes)
{
cout <<"the district 1 said yes: ";
district1++;
}

while(district1 == no)
{
cout <<" The district 1 said no:";
distric1++;
}


while(distric2 == yes)
{
cout <<"the distric 2 said yes";
distric2++;
}

i try this way but it does not work

You made a ton of spelling errors and you missed a semicolon.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.