[NTLUG:Discuss] C questions
Patrick R. Michaud
pmichaud at pobox.com
Mon Sep 19 11:43:23 CDT 2005
On Mon, Sep 19, 2005 at 11:16:53AM -0500, Fred James wrote:
> All
> Can anyone confirm for me that
> //
> is not an allowed syntax for a commnet line in ANSI C, please?
> (example:
> // line of text
> should be
> /* line of text */
> )
>From http://www.acm.uiuc.edu/webmonkeys/book/c_guide/1.1.html:
1.1.3 Comments
Comments in the source code are ignored by the compiler.
They are encapsulated starting with /* and ending with */.
According to the ANSI standard, nested comments are not allowed,
although some implementations allow it.
Single line comments are becoming more common, although not
defined in the ANSI standard. Single line comments begin with //
and are automatically terminated at the end of the current line.
> Can anyone confirm for me that
> _EXPORT is not a part of extern in ANSI C, please?
> (example:
> extern _EXPORT DataTable* createDataTable();
> should be
> extern DataTable* createDataTable();
> )
>From what I can tell, _EXPORT is usually a macro; it's not defined
by the ANSI C standard. However some compilers and packages seem to
use it to indicate symbols that need to be exported (and then the macro
can do the right thing for the specific compile environment).
If you really have code that you need to eliminate the _EXPORT
from, perhaps you can just define it as an empty macro rather
than literally removing it from the code:
#define _EXPORT
Pm
More information about the Discuss
mailing list