This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Bug in compiler

I,ve installed the Compiler and I can,t get even the simplest code to compile properely.

Anyone know where the fix for this bug is?

Or is it a limit of the demonstration version?

void main(void)
{ cout << "Hello world!";
}

Parents
  • Give a C program to someone who knows C++ - They will probably be able to follow it.

    Filip,

    This statement is a common source of problems. There are numerous scenarios where this does not hold true. That is, an expression that is both valid C and C++ can have different meanings in each.

    For example, imagine you see the following declaration in a source file:

    extern int foo();
    

    Without looking at another source file, can you tell me what this declaration means? That answer, of course, is that it depends on what language we're talking about. In C, this is a declaration for an unprototyped function having external linkage that takes an unspecified number and type of parameters. This means that within this C module, the following:

    foo();
    foo(x);
    foo(3.14159);
    

    would all compile just fine. C++ on the other hand, would consider this function to have been defined as extern int foo(void) and would not compile any attempts to pass parameters to it.

    The statement that "C++ is not just a superset of C" is a way of saying that there are enough of these divergent paths taken in the languages that one should become fluent in each rather than saying "since I know C++, I also know C."

    -Jay Daniel

Reply
  • Give a C program to someone who knows C++ - They will probably be able to follow it.

    Filip,

    This statement is a common source of problems. There are numerous scenarios where this does not hold true. That is, an expression that is both valid C and C++ can have different meanings in each.

    For example, imagine you see the following declaration in a source file:

    extern int foo();
    

    Without looking at another source file, can you tell me what this declaration means? That answer, of course, is that it depends on what language we're talking about. In C, this is a declaration for an unprototyped function having external linkage that takes an unspecified number and type of parameters. This means that within this C module, the following:

    foo();
    foo(x);
    foo(3.14159);
    

    would all compile just fine. C++ on the other hand, would consider this function to have been defined as extern int foo(void) and would not compile any attempts to pass parameters to it.

    The statement that "C++ is not just a superset of C" is a way of saying that there are enough of these divergent paths taken in the languages that one should become fluent in each rather than saying "since I know C++, I also know C."

    -Jay Daniel

Children
No data