error in function definition

This is a discussion on error in function definition within the C++ Programming forums, part of the General Programming Boards category; Can someone tell me what is wrong with this C++ function definition please? Code: void Test1 ( int m, int ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    12

    error in function definition

    Can someone tell me what is wrong with this C++ function definition please?

    Code:
    void Test1 ( int m,
                 int n)
    
    {
         return 3*m+n;
    }

  2. #2
    Registered User The Dog's Avatar
    Join Date
    May 2002
    Location
    Cape Town
    Posts
    788
    Your return type is wrong.
    Code:
    int Test1 ( int m, int n)  //Note the "int"
    {
         return 3*m+n;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Beginner Needs help in Dev-C++
    By Korrupt Lawz in forum C++ Programming
    Replies: 20
    Last Post: 09-28-2010, 02:17 AM
  2. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 12:45 PM
  3. We Got _DEBUG Errors
    By Tonto in forum Windows Programming
    Replies: 5
    Last Post: 12-22-2006, 05:45 PM
  4. load gif into program
    By willc0de4food in forum Windows Programming
    Replies: 14
    Last Post: 01-11-2006, 10:43 AM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 07:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21