What is wrong ?

This is a discussion on What is wrong ? within the C++ Programming forums, part of the General Programming Boards category; Hello. I would appreciate if you could help me with this problem, please. I have got a declaration of a ...

  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    31

    Question What is wrong ?

    Hello. I would appreciate if you could help me with this problem, please.

    I have got a declaration of a function like this ( in the header file ),

    Code:
    	int __fastcall IC(int x, int y, int &n);
    and I use it like

    Code:
    	IC(i, j - 1, n);
    i, j are integers and n is array of integers. It is declared like

    Code:
    	int n[180];
    When I try to run the application the debugger's output is this :


    [C++ Warning] go1.cpp(138): W8030 Temporary used for parameter 'n' in call to '_fastcall TMF::IC(int,int,int &)'

    [C++ Error] go1.cpp(138): E2034 Cannot convert 'int *' to 'int'

    [C++ Error] go1.cpp(138): E2342 Type mismatch in parameter 'n' (wanted 'int &', got 'int *')


    But I need to send the array of integers to the function and then the function to change it. At the same time I need the output of the function which is an integer as well. I am using BCPPB 6.0. Could you help me? Thank you in advance.

  2. #2
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,075
    Try this:
    Code:
    int __fastcall IC(int x, int y, int n[]);
    Sent from my iPadŽ

  3. #3
    Registered User
    Join Date
    Aug 2005
    Posts
    31
    I have already found a different solution, but thank you anyway.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 04:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 01:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 02:04 PM

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