errors on debug

This is a discussion on errors on debug within the C Programming forums, part of the General Programming Boards category; Hey guys, I am writing a program for an assignment that uses functions to allow the user to input a ...

  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    8

    errors on debug

    Hey guys,

    I am writing a program for an assignment that uses functions to allow the user to input a base and an exponent, and to display the power raised to the exponent and exit via a menu.

    One of the functions is for the power calculation, which my friend helped me with, but when I go to debug my program, I am getting two syntax errors, and some weird error about how the function for power has too few arguments for call.

    I think my while loop for the menu might be a little wrong also.

    I have attached my source code for you to look at.

    Note: DO NOT send me a completed program!
    Attached Files Attached Files

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,820
    It's just
    result = calculate_Power(base, exponent);
    when you call it.
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    7,758
    If you write something like
    Code:
    if (base >= min && base <= max)
    ;{
        return 1;
    }
    Then what results in terms of program execution is that the if statement does nothing, and the return statement always executes. This type of mistake is repeated throughout the program several times... look over your code closer.

    It also seems that your main while loop and program flow should depend on the variable c since that has what the user wants to do as a value.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Header File Errors...
    By Junior89 in forum C++ Programming
    Replies: 5
    Last Post: 07-08-2007, 01:28 AM
  2. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 08:42 AM
  3. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 03:01 PM
  4. executing errors
    By s0ul2squeeze in forum C++ Programming
    Replies: 3
    Last Post: 03-26-2002, 01:43 PM

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