expression syntax

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zachariahmagall
    New Member
    • Nov 2012
    • 1

    expression syntax

    this is my program which brings me syntax expression.,hel p me
    Code:
    #include<iostream.h>
    #include<conio.h>
    void main()
    {
    int x;
    cout<<"enter number"<<endl;
    cin>>x;
    cout<<"number entered is:"<<endl;
    getch();
    }
    Last edited by Meetee; Nov 16 '12, 09:09 AM. Reason: please use code tags <code/> around your code
  • PreethiGowri
    New Member
    • Oct 2012
    • 126

    #2
    use int main() instead of void,
    since most of the editors does not support void

    Comment

    • Banfa
      Recognized Expert Expert
      • Feb 2006
      • 9067

      #3
      I don't know what "syntax expression" means but if you are getting compiler errors then copy and paste the entire error as it appears.

      Use int main() instead of void main() but not because of editor incompatibility but rather because in C++ void main() produces undefined behaviour which should be avoided.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        Depending upon how old your compiler is, there were versions long ago that used iostream.h but also implemented namespaces. You may be missing a using namespace std; declaration.

        The old compilers were Unix/Linux only.

        Comment

        Working...