+ 1

Can Functions with Void type have Parameters?

12th Apr 2018, 7:03 PM
RiGeL
RiGeL - avatar
3 Answers
+ 1
yes, you can have functions like this void print(int x) { cout << "x= " << x; }
12th Apr 2018, 7:06 PM
đŸ‡źđŸ‡· M N
+ 1
Sure. If you just print the value, or manipulate a value you passed as reference. Arguments don't relate to return type.
12th Apr 2018, 7:05 PM
Alex
Alex - avatar
0
12th Apr 2018, 8:32 PM
RiGeL
RiGeL - avatar