Thread: errors on debug

  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!

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    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.

  3. #3
    Lurking whiteflags's Avatar
    Join Date
    Apr 2006
    Location
    United States
    Posts
    9,612
    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, 12:28 AM
  2. Linker errors in VC++ 2005
    By C+/- in forum C++ Programming
    Replies: 0
    Last Post: 05-18-2007, 07: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