-4

I just learn C++ and i don't understand what is the used of return even with the help of google, here is a code that returns the value 9 to returnvalue but the output of the code below is 1 why is this so won't 9 = returnvalue? If not then can i return any value back to my function will that affect anything?

#include <iostream>
using namespace std;
int returnvalue(){
    return 9;}
int main(){
    cout<<returnvalue;}
user4581301
  • 33,082
  • 7
  • 33
  • 54
user93228
  • 3
  • 2

1 Answers1

1

You're feeding std::cout a funtion pointer to returnvalue instead of calling it, to call it add ():

cout<<returnvalue();
Hatted Rooster
  • 35,759
  • 6
  • 62
  • 122