Need help in this program.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Itachi Uchiha
    New Member
    • Dec 2013
    • 1

    Need help in this program.

    Hi , I dont know what's wrong in this code, there is are 2 red "x" on left side of the program written,how do i fix them b'coz of it the program doesn't build & I m new to c++ and i use eclipse.



    [imgnothumb]http://bytes.com/attachment.php? attachmentid=73 87[/imgnothumb]
    Attached Files
    Last edited by zmbd; Dec 21 '13, 04:41 PM. Reason: [Z{Made attached images visable}{Please note:For code we prefer the text be typed into the post and formated with [CODE/ button}]
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    You are using the clrscr() function which is non-standard in C++.

    Better to include stdlib.h and use system("cls").

    Comment

    • donbock
      Recognized Expert Top Contributor
      • Mar 2008
      • 2427

      #3
      There is a legitimate case to be made either way in the clrscr() vs system("cls") debate. Another option is to send a bunch of newlines to cout.

      Whichever way you choose to go is nonportable in some manner:
      • some platforms may not provide a clrscr() function
      • some platforms may use a different system command than cls to clear the screen
      • some platforms may need more newlines to clear the entire screen.

      Comment

      • aselvan07
        New Member
        • Dec 2013
        • 4

        #4
        The other error you see is basically saying that the return type of main has to be an
        Code:
        int
        .

        Comment

        Working...