Error when calling a function | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Error when calling a function

The function works just fine, but when I try to call the function in the driver part of the code (main) I get an 2 errors on line 13 expected expression before float and too few arguments to function input. input(float sales, int i); ^~~~~ input(float sales, int i); ^~~~~ https://code.sololearn.com/cOi8WCHOL15l/?ref=app

4th Dec 2018, 4:21 PM
Josiah Mitchell
Josiah Mitchell - avatar
1 Answer
+ 3
You mustn't use data types when calling a function, but when declaring it: void test(int a) { // declaring test code... } int i = 0; test(i); // calling test Btw. I tried to fix your code a little bit: https://code.sololearn.com/cm3JiiSnrxsu/?ref=app
4th Dec 2018, 4:49 PM
Aaron Eberhardt
Aaron Eberhardt - avatar