hello, can someone please tell my why the following method of calling a function does not work??
i know what the problem is , in fact i have fixed it already but i cannot understand what is wrong.Code:#include <iostream> int test1(int x){ return x* 12; } int test2(int x){ return x*12; } int main(){ int test1, test2; /* if i rename all occurences of these to something that is different that function names then it works*/ std::cin >> test1 >> test2; std::cout << test1(test1) << std::endl << test2(test2) << std::endl; }
if it illegal in c++ to use the name of a function as the parameter being passed to the said function?
please see my comment on where i fixed it to work
thank you