Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

why the program dosent know about "void" function?

+1 vote
asked Nov 28, 2018 by Oz Keshet (130 points)
main.cpp: In function ‘int main()’:
main.cpp:27:5: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream}’ and ‘void’)
 cout<<arithmetic(difference,first_num);

1 Answer

0 votes
answered Nov 28, 2018 by Юрий Гуреев (1,100 points)
edited Nov 28, 2018 by Юрий Гуреев
Because your function should return something to use cout <<, but it returns nothing. Also if function returns not built-in type you should to overload << operator for it
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...