Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

I am stupid

Name: pieisgood 2008-02-09 13:48

Ok... I have been reading a book on programming and some such and I wanted to make a simple function. I am doing it wrong though.
This won't let me refer to "addition" more than once or else the compiler throws a bitch fit. Why is that?
#include <cstdlib>
#include <iostream>

using namespace std;

int main ()
{
    char MenuA;
    cout << "please enter A for addition: ";
    cin >> MenuA;
    float x, y, aso;
   
    double addition ();
    {
           cout << "please enter the first number to be added: ";
           cin >> x;
           cout << "please enter the second number to be added: ";
           cin >> y;
          
           aso = x + y;
          
           cout << "the solution is: " << aso;
         
          
           }
   
   
    if ( MenuA == 'A')
    {
         addition;
         }
         else if (MenuA != 'A')
         {
              cout << "you must enter A";
              }
  
             
              return 0;
              }

Name: Anonymous 2008-02-09 13:53

addition; is a reference, not call.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List