Thread: Recursion

  1. #1
    Registered User
    Join Date
    Oct 2002
    Posts
    3

    Question Recursion

    I can't get this program to compile. Gives me error that I am missing function header...Help

    #include <stdio.h>

    void Mystery(int A[], int size);


    {

    if(size>0) {
    A[0] = 0;
    Mystery (A+1, size - 1);
    }
    }

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,897
    >void Mystery(int A[], int size);
    Remove the semicolon here.

    -Prelude
    My best code is written with the delete key.

  3. #3
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    void Mystery(int A[], int size);

    here you declare a function but what you are trying to do is define it so remove that semicolon and it should compile. You will need to write a main() function too.
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Template Recursion Pickle
    By SevenThunders in forum C++ Programming
    Replies: 20
    Last Post: 02-05-2009, 09:45 PM
  2. Recursion... why?
    By swgh in forum C++ Programming
    Replies: 4
    Last Post: 06-09-2008, 09:37 AM
  3. a simple recursion question
    By tetra in forum C++ Programming
    Replies: 6
    Last Post: 10-27-2002, 10:56 AM
  4. To Recur(sion) or to Iterate?That is the question
    By jasrajva in forum C Programming
    Replies: 4
    Last Post: 11-07-2001, 09:24 AM
  5. selection sorting using going-down and going-up recursion
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-02-2001, 02:29 PM