Thread: Why do I get error: a function-definition is not allowed here before '{' token

  1. #1
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7

    Why do I get error: a function-definition is not allowed here before '{' token

    I am trying to write 4 functions for 4 operators but can not figure out what I am doing wrong. I get the error a function-definition is not allowed here before '' token. I have tried moving and changing everything for hours but no luck. Any help would be much appreciated. thanks.

    Code:
    #include <iostream>
    #include <string>
    using namespace std;
     void add( int , int );
     void subtract( int , int );
     void multiply( int , int );
     void divide( int , int );
    
      int main ()
    
      {
      int a;
      int b;
      int operato;
    
          cout << "Please enter your first number ";
          cin  >> a;
          cout << "Please enter your second number ";
          cin >> b;
          cout << "Please choose one of the following with the number only: " << endl;
          cout << '\t' << " 1) Add " <<  endl;
          cout << '\t' << " 2) Subtract " << endl;
          cout << '\t' << " 3) Multiply " << endl;
          cout << '\t' << " 4) Divide " << endl;
          cin >> operato;
    
          if (operato == 1)
          {
              cout << a << " + " << b << " = " << add << endl;
          }
          else if (operato == 2)
          {
              cout << a << " - " << b <<  " = " << subtract << endl;
          }
          else if (operato == 3)
          {
              cout << a << " * " << b <<  " = " <<  multiply << endl;
          }
          else //operator == 4
          {
              cout << a << " / " << b <<  " = " << divide << endl;
          }
      int add(int a, int b)
      {
          return a + b;
      }
      int subtract(int a, int b)
      {
          return a - b;
      }
      int multiply( int a, int b)
      {
          return a * b;
      }
      int divide( int a, int b)
      {
          return a / b;
      }
    
      }

  2. #2
    Guest
    Guest
    You are trying to pass a function to your output stream:
    Code:
    cout << add << endl;
    But what you need to do is invoke it (you want its output), and with the variables you introduced:
    Code:
    cout << add(a, b) << endl;
    Also, your function definitions shouldn't be inside the main function itself; you can move them below it. And their signatures don't match your declaration:
    Code:
    void add(int, int); // void return type
    int add(int a, int b) // int return type (what you want)
    { }
    Last edited by Guest; 06-21-2015 at 10:11 AM.

  3. #3
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7
    Sorry but I am now more confused with more errors. I added the "invocation" with the add(a, b). Then I tried to put the functions below main and then the compiler just generated a ton of errors.

    Code:
    #include <iostream>
    #include <string>
    using namespace std;
    void add( int a, int b );
    void subtract( int a, int b );
    void multiply( int a, int b );
    void divide( int a, int b);
    int main ()
    {
    int a;
    int b;
    int operato;
        cout << "Please enter your first number ";
        cin  >> a;
        cout << "Please enter your second number ";
        cin >> b;
        cout << "Please choose one of the following with the number only: " << endl;
        cout << '\t' << " 1) Add " <<  endl;
        cout << '\t' << " 2) Subtract " << endl;
        cout << '\t' << " 3) Multiply " << endl;
        cout << '\t' << " 4) Divide " << endl;
        cin >> operato;
    
        if (operato == 1)
        {
            cout << a << " + " << b << " = " << add(a, b) << endl;
        }
        else if (operato == 2)
        {
            cout << a << " - " << b <<  " = " << subtract(a, b) << endl;
        }
        else if (operato == 3)
        {
            cout << a << " * " << b <<  " = " <<  multiply(a, b) << endl;
        }
        else //operator == 4
        {
            cout << a << " / " << b <<  " = " << divide(a, b) << endl;
        }
    }
    int add(int a, int b)
    {
        return a + b;
    }
    int subtract(int a, int b)
    {
        return a - b;
    }
    int multiply( int a, int b)
    {
        return a * b;
    }
    int divide( int a, int b)
    {
        return a / b;
    }

  4. #4
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Notice that you forward declared the functions as having a return type of void:
    Code:
    void add( int a, int b );
    void subtract( int a, int b );
    void multiply( int a, int b );
    void divide( int a, int b);
    But you correctly defined them as having a return type of int.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  5. #5
    Guest
    Guest
    Probably to do with the functions signatures i mentioned. On line 4 you declare
    Code:
    void add(int, int)
    But on line 41 you define it as
    Code:
    int add(int a, int b)
    The int return type is what you want here, so change lines 4, 5, 6, 7 to return int as well, just like you definitions at the bottom.

    If that doesn't solve it, consider pasting your compiler errors. You can also use a service like pastebin or so, if you don't want to post a wall of text.

  6. #6
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7
    Code:
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|5|error: expected unqualified-id before '{' token|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|10|error: expected unqualified-id before '{' token|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|15|error: expected unqualified-id before '{' token|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|20|error: expected unqualified-id before '{' token|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp||In function 'int main()':|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|error: no match for 'operator<<' in 'std::operator<< <std::char_traits<char> >((* &(& std::operator<< <std::char_traits<char> >((* & std::cout.std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(a)), ((const char*)" + ")))->std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(b)), ((const char*)" = ")) << add(a, b)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note: candidates are:|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note:   no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note:   no known conversion for argument 1 from 'void' to 'long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note:   no known conversion for argument 1 from 'void' to 'long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note:   no known conversion for argument 1 from 'void' to 'bool'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note:   no known conversion for argument 1 from 'void' to 'short int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note:   no known conversion for argument 1 from 'void' to 'short unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note:   no known conversion for argument 1 from 'void' to 'int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note:   no known conversion for argument 1 from 'void' to 'unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note:   no known conversion for argument 1 from 'void' to 'long long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note:   no known conversion for argument 1 from 'void' to 'long long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note:   no known conversion for argument 1 from 'void' to 'double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note:   no known conversion for argument 1 from 'void' to 'float'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note:   no known conversion for argument 1 from 'void' to 'long double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note:   no known conversion for argument 1 from 'void' to 'const void*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   deduced conflicting types for parameter '_CharT' ('char' and 'void')|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'signed char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'unsigned char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   mismatched types 'const _CharT*' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'const signed char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|47|note:   cannot convert 'add(a, b)' (type 'void') to type 'const unsigned char*'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|error: no match for 'operator<<' in 'std::operator<< <std::char_traits<char> >((* &(& std::operator<< <std::char_traits<char> >((* & std::cout.std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(a)), ((const char*)" - ")))->std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(b)), ((const char*)" = ")) << subtract(a, b)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note: candidates are:|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note:   no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note:   no known conversion for argument 1 from 'void' to 'long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note:   no known conversion for argument 1 from 'void' to 'long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note:   no known conversion for argument 1 from 'void' to 'bool'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note:   no known conversion for argument 1 from 'void' to 'short int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note:   no known conversion for argument 1 from 'void' to 'short unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note:   no known conversion for argument 1 from 'void' to 'int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note:   no known conversion for argument 1 from 'void' to 'unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note:   no known conversion for argument 1 from 'void' to 'long long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note:   no known conversion for argument 1 from 'void' to 'long long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note:   no known conversion for argument 1 from 'void' to 'double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note:   no known conversion for argument 1 from 'void' to 'float'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note:   no known conversion for argument 1 from 'void' to 'long double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note:   no known conversion for argument 1 from 'void' to 'const void*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   deduced conflicting types for parameter '_CharT' ('char' and 'void')|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'signed char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'unsigned char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   mismatched types 'const _CharT*' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'const signed char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|51|note:   cannot convert 'subtract(a, b)' (type 'void') to type 'const unsigned char*'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|error: no match for 'operator<<' in 'std::operator<< <std::char_traits<char> >((* &(& std::operator<< <std::char_traits<char> >((* & std::cout.std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(a)), ((const char*)" * ")))->std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(b)), ((const char*)" = ")) << multiply(a, b)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note: candidates are:|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note:   no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note:   no known conversion for argument 1 from 'void' to 'long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note:   no known conversion for argument 1 from 'void' to 'long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note:   no known conversion for argument 1 from 'void' to 'bool'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note:   no known conversion for argument 1 from 'void' to 'short int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note:   no known conversion for argument 1 from 'void' to 'short unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note:   no known conversion for argument 1 from 'void' to 'int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note:   no known conversion for argument 1 from 'void' to 'unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note:   no known conversion for argument 1 from 'void' to 'long long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note:   no known conversion for argument 1 from 'void' to 'long long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note:   no known conversion for argument 1 from 'void' to 'double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note:   no known conversion for argument 1 from 'void' to 'float'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note:   no known conversion for argument 1 from 'void' to 'long double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note:   no known conversion for argument 1 from 'void' to 'const void*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   deduced conflicting types for parameter '_CharT' ('char' and 'void')|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'signed char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'unsigned char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   mismatched types 'const _CharT*' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'const signed char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|55|note:   cannot convert 'multiply(a, b)' (type 'void') to type 'const unsigned char*'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|error: no match for 'operator<<' in 'std::operator<< <std::char_traits<char> >((* &(& std::operator<< <std::char_traits<char> >((* & std::cout.std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(a)), ((const char*)" / ")))->std::basic_ostream<_CharT, _Traits>::operator<< <char, std::char_traits<char> >(b)), ((const char*)" = ")) << divide(a, b)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note: candidates are:|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|106|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|115|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|125|note:   no known conversion for argument 1 from 'void' to 'std::ios_base& (*)(std::ios_base&)'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|164|note:   no known conversion for argument 1 from 'void' to 'long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|168|note:   no known conversion for argument 1 from 'void' to 'long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|172|note:   no known conversion for argument 1 from 'void' to 'bool'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|93|note:   no known conversion for argument 1 from 'void' to 'short int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|179|note:   no known conversion for argument 1 from 'void' to 'short unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|107|note:   no known conversion for argument 1 from 'void' to 'int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|190|note:   no known conversion for argument 1 from 'void' to 'unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|199|note:   no known conversion for argument 1 from 'void' to 'long long int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|203|note:   no known conversion for argument 1 from 'void' to 'long long unsigned int'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|218|note:   no known conversion for argument 1 from 'void' to 'double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|222|note:   no known conversion for argument 1 from 'void' to 'float'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|230|note:   no known conversion for argument 1 from 'void' to 'long double'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|243|note:   no known conversion for argument 1 from 'void' to 'const void*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|121|note:   no known conversion for argument 1 from 'void' to 'std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::basic_string<_CharT, _Traits, _Alloc>&)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\basic_string.h|2750|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   mismatched types 'const std::basic_string<_CharT, _Traits, _Alloc>' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|469|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   deduced conflicting types for parameter '_CharT' ('char' and 'void')|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|474|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|480|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|486|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'signed char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|491|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'unsigned char'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|511|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   mismatched types 'const _CharT*' and 'void'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\bits\ostream.tcc|323|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|528|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'const char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|541|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'const signed char*'|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)|
    c:\program files (x86)\codeblocks\mingw\bin\..\lib\gcc\mingw32\4.7.1\include\c++\ostream|546|note:   template argument deduction/substitution failed:|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|59|note:   cannot convert 'divide(a, b)' (type 'void') to type 'const unsigned char*'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp||In function 'int add(int, int)':|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|62|error: new declaration 'int add(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|4|error: ambiguates old declaration 'void add(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp||In function 'int subtract(int, int)':|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|66|error: new declaration 'int subtract(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|9|error: ambiguates old declaration 'void subtract(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp||In function 'int multiply(int, int)':|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|70|error: new declaration 'int multiply(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|14|error: ambiguates old declaration 'void multiply(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp||In function 'int divide(int, int)':|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|74|error: new declaration 'int divide(int, int)'|
    C:\Users\Owner\Documents\Get rid of main\Chapter 3\calc fx ch 6.cpp|19|error: ambiguates old declaration 'void divide(int, int)'|
    ||=== Build failed: 16 error(s), 0 warning(s) (0 minute(s), 6 second(s)) ===|
    I don't know if this helps. To me it is just a big mess. Thank you for your help.

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by soesbanditjim
    I don't know if this helps. To me it is just a big mess. Thank you for your help.
    Have you made the fixes concerning the return type of the functions as mentioned by Guest in posts #2 and #5 and by me in post #4? Fixing those will likely remove the huge chunk of error messages that you're seeing. A huge chunk of error messages don't always mean a huge swath of errors as a single error can result in such a lengthy error message, especially when template code is involved.

    If you have made the fixes, then post your current code. If you have not, then make them and compile.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7
    laserlight I guess I didn't know you told me to make a change somewhere. I know you said I forward declared the functions but I didn't know where to make changes. Here is what I have now that the compiler gave the above errors. Thanks for the help.

    Code:
    #include <iostream>
    #include <string>
    using namespace std;
    void add( int a, int b );
    {
        return a + b;
    }
    void subtract( int a, int b );
    {
        return a - b;
    }
    void multiply( int a, int b );
    {
        return a * b;
    }
    void divide( int a, int b);
    {
        return a / b;
    }
    
    int main ()
    {
    int a;
    int b;
    int operato;
        cout << "Please enter your first number ";
        cin  >> a;
        cout << "Please enter your second number ";
        cin >> b;
        cout << "Please choose one of the following with the number only: " << endl;
        cout << '\t' << " 1) Add " <<  endl;
        cout << '\t' << " 2) Subtract " << endl;
        cout << '\t' << " 3) Multiply " << endl;
        cout << '\t' << " 4) Divide " << endl;
        cin >> operato;
    
        if (operato == 1)
        {
            cout << a << " + " << b << " = " << add(a, b) << endl;
        }
        else if (operato == 2)
        {
            cout << a << " - " << b <<  " = " << subtract(a, b) << endl;
        }
        else if (operato == 3)
        {
            cout << a << " * " << b <<  " = " <<  multiply(a, b) << endl;
        }
        else //operator == 4
        {
            cout << a << " / " << b <<  " = " << divide(a, b) << endl;
        }
    }
    int add(int a, int b)
    {
        return a + b;
    }
    int subtract(int a, int b)
    {
        return a - b;
    }
    int multiply( int a, int b)
    {
        return a * b;
    }
    int divide( int a, int b)
    {
        return a / b;
    }

  9. #9
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    FYI: By fixing the function prototypes no one meant you to turn them into function with syntax errors.

    Code:
    void add( int a, int b ); // This ";" is causing this function syntax and the errors.
    {
        return a + b; // void means there is no return of value allowed.
    }
    Tim S.
    "...a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are,in short, a perfect match.." Bill Bryson

  10. #10
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7
    Finally! Thank you everyone. However, this is now similar to what I actually did EXCEPT I used result instead of return when I was declaring my functions. Can someone tell me the difference between return and result and when you use them? Thanks for the help on this!

    Code:
    #include <iostream>
    #include <string>
    using namespace std;
    int add( int a, int b )
    {
        return a + b;
    }
    int subtract( int a, int b )
    {
        return a - b;
    }
    int multiply( int a, int b )
    {
        return a * b;
    }
    int divide( int a, int b)
    {
        return a / b;
    }
    
    int main ()
    {
    int a;
    int b;
    int operato;
        cout << "Please enter your first number ";
        cin  >> a;
        cout << "Please enter your second number ";
        cin >> b;
        cout << "Please choose one of the following with the number only: " << endl;
        cout << '\t' << " 1) Add " <<  endl;
        cout << '\t' << " 2) Subtract " << endl;
        cout << '\t' << " 3) Multiply " << endl;
        cout << '\t' << " 4) Divide " << endl;
        cin >> operato;
    
        if (operato == 1)
        {
            cout << a << " + " << b << " = " << add(a, b) << endl;
        }
        else if (operato == 2)
        {
            cout << a << " - " << b <<  " = " << subtract(a, b) << endl;
        }
        else if (operato == 3)
        {
            cout << a << " * " << b <<  " = " <<  multiply(a, b) << endl;
        }
        else //operator == 4
        {
            cout << a << " / " << b <<  " = " << divide(a, b) << endl;
        }
    }

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by soesbanditjim View Post
    ...I used result instead of return when I was declaring my functions.
    What does this even mean?
    The original problem was basically that you mixed up your declarations and definitions:

    Declaration:
    void add( int a, int b );

    Definition:
    int add( int a, int b )

    The declarations and definitions must look EXACTLY the same (except the definitions must provide a body, while the declarations ends with a semicolon).
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Registered User
    Join Date
    Jun 2015
    Location
    Grand Island, NY
    Posts
    7
    I'm sorry I meant before I posted on the site. I tried a lot of coding before I posted. Thanks for the help!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Calling a function: syntax error before ']' token
    By MC++ in forum C Programming
    Replies: 8
    Last Post: 12-05-2011, 09:56 PM
  2. Replies: 3
    Last Post: 04-01-2011, 03:31 PM
  3. Replies: 3
    Last Post: 10-02-2010, 10:18 AM
  4. Replies: 2
    Last Post: 01-25-2010, 01:55 AM
  5. function-definition is not allowed here ?
    By kryptkat in forum Windows Programming
    Replies: 5
    Last Post: 03-26-2008, 01:13 PM