Thread: heilo! recursion on sum(int a[], int n)

  1. #1
    Registered User
    Join Date
    Feb 2005
    Location
    city of waterfalls
    Posts
    3

    Unhappy heilo! recursion on sum(int a[], int n)

    greetings!
    anyone could help me here!
    the problem is adding all the data in an array given the said parameter! keep me posted then!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Recursion is just a needless complication (ie student exercise).

    Try showing us that you can do it using a normal loop first.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    Here's a link to the FAQs entry regarding an introduction to recursion. If you MUST use recursion to complete your task, then this presentation should help you get started. Once you have attempted a solution please come back with a specific question including pertinent code, error message relating to a specific line, etc.


    http://faq.cprogramming.com/cgi-bin/...&id=1073086407
    You're only born perfect.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Working with random like dice
    By SebastionV3 in forum C++ Programming
    Replies: 10
    Last Post: 05-26-2006, 09:16 PM
  2. Game Won't Compile
    By jothesmo in forum C++ Programming
    Replies: 2
    Last Post: 04-01-2006, 04:24 PM
  3. Replies: 2
    Last Post: 03-24-2006, 08:36 PM
  4. Switch/case Problems (long code in post)
    By Wraithan in forum C++ Programming
    Replies: 2
    Last Post: 12-01-2005, 06:40 PM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM