Unknown C++ compile error

Discussion in 'Software' started by Cobra, May 21, 2005.

  1. Cobra

    Cobra Private First Class

    I just started out with C++ and I am writing the program http://newdata.box.sk/bx/c/htm/ch01.htm#Heading26 under excercise 1. I have tried compiling it but it gives errors:


    C:\Borland\BCC55\Bin>bcc32 hello.cpp
    Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
    hello.cpp:
    Error E2379 hello.cpp 6: Statement missing ; in function main()
    Error E2379 hello.cpp 8: Statement missing ; in function main()
    *** 2 errors in Compile ***

    Here is what is in the program:

    #include <iostream.h>
    int main()
    {
    int x = 5;
    int y = 7;
    cout "\n";
    cout << x + y << " " << x * y;
    cout "\n";
    return 0;
    }

    Can someone tell me what is going on. I am using the free Borland C/C++ compiler.
     
  2. Maxwell

    Maxwell Folgers

  3. iamien

    iamien Cptn "Eh!"

    For the future, please use code tags, just for any code. it realy helps..

    Code:
    int Othello::CheckDir(int x, int y, int modX, int modY, int cnt)
    {
    int result;
    x += modX;
    y += modY;
    if ( (  x > 0 ) && ( x   < BOARD_SIZE)  && ( y  > 0) && (y + modY < BOARD_SIZE) )
    {
    	if (theBoard[x][y] == blank) 
    		return 0;
    	else
    	if( theBoard[x][y] != currentPlayer  )
    	{
    		result = CheckDir(x,y,modX, modY, cnt+ 1);
    		if ( result > 0 && !testing)
    		{
    			if (currentPlayer == white)
    			{
    				theBoard[x][y] = white;
    			}
    			else
    			{
    				theBoard[x][y] = black;
    			}
    		
    		
    		}
    		return result;
    	}
    	else
    		return cnt;
    }
    else
    	return 0;
    
    
    }
    
    compared too

    int Othello::CheckDir(int x, int y, int modX, int modY, int cnt)
    {
    int result;
    x += modX;
    y += modY;
    if ( ( x > 0 ) && ( x < BOARD_SIZE) && ( y > 0) && (y + modY < BOARD_SIZE) )
    {
    if (theBoard[x][y] == blank)
    return 0;
    else
    if( theBoard[x][y] != currentPlayer )
    {
    result = CheckDir(x,y,modX, modY, cnt+ 1);
    if ( result > 0 && !testing)
    {
    if (currentPlayer == white)
    {
    theBoard[x][y] = white;
    }
    else
    {
    theBoard[x][y] = black;
    }


    }
    return result;
    }
    else
    return cnt;
    }
    else
    return 0;


    }
    thanks.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds