CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Threaded View

  1. #3
    Join Date
    Jul 2005
    Location
    Netherlands
    Posts
    2,042

    Re: Problem With Declaring Variables In A Function

    Edit: didn't notice this was about C, not C++.

    If I compile your code with the Comeau online compiler, I only get one error (and some warnings).
    Code:
    Comeau C/C++ 4.3.10.1 (Oct  6 2008 11:28:09) for ONLINE_EVALUATION_BETA2
    Copyright 1988-2008 Comeau Computing.  All rights reserved.
    MODE:strict errors C++ C++0x_extensions
    
    "ComeauTest.c", line 10: error: return type "int" omitted in declaration of function
              "main", so use int main() OR int main(int argc, char *argv[])
      main()
      ^
    ...
    1 error detected in the compilation of "ComeauTest.c".
    Are you sure you compiled the exact code you posted?
    Last edited by D_Drmmr; November 12th, 2012 at 12:30 PM.
    Cheers, D Drmmr

    Please put [code][/code] tags around your code to preserve indentation and make it more readable.

    As long as man ascribes to himself what is merely a posibility, he will not work for the attainment of it. - P. D. Ouspensky

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured