Please help me with the function header, it makes me go crazy!

This is a discussion on Please help me with the function header, it makes me go crazy! within the C++ Programming forums, part of the General Programming Boards category; I made a code which calculates the area of things and it works fine, but I can never use it ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    367

    Angry Please help me with the function header, it makes me go crazy!

    I made a code which calculates the area of things and it works fine, but I can never use it as a function and call it, here goes the variables which I use in the function:
    ------------------------------------------------------------------------------------
    float x;
    float y;
    float z;
    float area;
    int KeepOn;
    ------------------------------------------------------------------------------------
    and as header I use this:

    float CalcArea(float x, float y, float z, float area, int KeepOn)

    And here I put it in the main program:
    ------------------------------------------------------------------------------------
    int main()
    {

    float CalcArea(float x, float y, float z, float area, int KeepOn);

    return 0;

    }
    ------------------------------------------------------------------------------------
    The problem is that the compiler says that it shadows a parameter. As I said, this makes me go CrAZy, HELP WANTED!!!!!!

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    559
    The calling function uses arguments only. In the called function you also use the data types.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 03:07 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  3. Replies: 30
    Last Post: 06-19-2006, 01:35 AM
  4. Bisection Method function value at root incorrect
    By mr_glass in forum C Programming
    Replies: 3
    Last Post: 11-10-2005, 09:10 AM
  5. Header file for "fix" function ?
    By Rex in forum C++ Programming
    Replies: 1
    Last Post: 04-08-2003, 05:42 AM

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