debug help

This is a discussion on debug help within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> using namespace std; void check(double a, double b) int main() { double xleft = 0; double xright ...

  1. #1
    Registered User
    Join Date
    Oct 2004
    Posts
    13

    debug help

    Code:
    #include <iostream>
    using namespace std;
    void check(double a, double b)
    
    int main()
    {
    double xleft = 0;
    double xright = 0;
    
    cout << "Please enter xleft " << endl;
    cin >> xleft;
    cout << "Please enter xright" << endl;
    cin >> xright;
    check(xleft, xright);
    
    return 0;
    }
    
    
    void check(a,b)
    {
    	if(a > b)
    		cout << "Bisection can not be computed (sign error, or xleft is greater than xright)" endl;
    }
    could anyone help me figure out the compiler error on this program?
    1. unexpected end of file found
    2. missing ; before identifier main.
    thank you.

  2. #2
    Occasionally correct Mr.OC's Avatar
    Join Date
    Oct 2004
    Posts
    6
    You left out the semi-colon (';') after the function prototype.

    Replace this...
    Code:
    void check(double a, double b)
    With this...
    Code:
    void check(double a, double b);
    That, and your call to cout.

    Try this, instead:
    Code:
    cout << "Bisection can not be computed (sign error, or xleft is greater than xright)" << endl;

  3. #3
    Registered User
    Join Date
    Oct 2004
    Posts
    13
    thank you thank you.
    im so stupid:S

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary not built with debug info - why?
    By ulillillia in forum C Programming
    Replies: 15
    Last Post: 12-11-2008, 01:37 AM
  2. makefiles - debug & release?
    By cpjust in forum C Programming
    Replies: 6
    Last Post: 10-26-2007, 05:00 PM
  3. Debug --> Exceptions in Visual Studio 2005
    By George2 in forum C# Programming
    Replies: 1
    Last Post: 08-10-2007, 03:12 AM
  4. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 12:08 PM
  5. Ask about Debug Assert Failed
    By ooosawaddee3 in forum C++ Programming
    Replies: 0
    Last Post: 04-25-2002, 12:07 AM

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