• Register
Welcome to Kodlogs, programming questions and answer website.
0 votes
53 views

 #include <iostream>

using namespace std123;

struct Test123

{

int text_r1;

int text_r2

int text_r3

};

void get_text_data(StatePoll &thing);

void print_pie(int num);

void main()

{

StatePoll thing;

get_vote_data(thing);

cout<<" Republicans: "<<print_pie(thing.text_r1)<<"\n";

cout<<"   Democrats: "<<print_pie(thing.dem_votes)<<"\n";

cout<<"Independents: "<<print_pie(thing.ind_votes)<<"\n";

system("pause");

}

void get_vote_data(StatePoll &thing)

{

cout<<"Number of votes for republicans: ";

cin>>thing.text_r1;

cout<<"\n\n";

cout<<"Number of votes for democrats: ";

cin>>thing.text_r2

cout<<"\n\n";

cout<<"Number of votes for indepentents: ";

cin>>thing.text_r3

cout<<"\n\n";

}

void print_bar(int num)

{

int d123= num/1000;

if(num % 1000 != 0)

{

d123 += d123;

}

for(int x=0; x<d123;; x++)

{

cout<<"*";

}

cout<<"\n";

}‚Äč

by (1.6k points)  
reshown by

1 Answer

0 votes

Don't pass the return value of the print_pie function into the stream operator. However, print_pie is a void function and doesn't return anything.

by (9.8k points)  
edited by
...