Standard question

B

Bill Cunningham

I think I have a standard question here. ISO or ANSI. Some of the developers
on this site have shown me code in this form

int name(int x,y);

Now my compiler just will not accept that. It has to be
int name (int x,int y);

Is my compiler a C99 compiler?

Bill
 
E

Emmanuel Delahaye

Bill Cunningham said:
I think I have a standard question here. ISO or ANSI. Some of the
developers on this site have shown me code in this form

What site ?
int name(int x,y);

AFAIK, this is incorrect C.
Now my compiler just will not accept that. It has to be
int name (int x,int y);

Sounds correct to me.
 
M

Mark McIntyre

I think I have a standard question here. ISO or ANSI. Some of the developers
on this site have shown me code in this form

int name(int x,y);

Now my compiler just will not accept that. It has to be
int name (int x,int y);

Is my compiler a C99 compiler?

No, its just a C compiler. The first form is illegal.
 
L

Leor Zolman

I think I have a standard question here. ISO or ANSI. Some of the developers
on this site have shown me code in this form

int name(int x,y);

Are you sure you weren't perhaps shown this:

int name(x, y)
int x,y;
{
...
}

which is and old-style ("K&R", or Classic) C construct grandfathered in to
even the current standard?
-leor


Leor Zolman
BD Software
(e-mail address removed)
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html
 
B

Bill Cunningham

Are you sure you weren't perhaps shown this:
int name(x, y)
int x,y;
{
...
}

which is and old-style ("K&R", or Classic) C construct grandfathered in to
even the current standard?
-leor

I don't think so. I've never written source like that. I don't think I'd
recognize it especially if it's classic k&r.

Bill
 
L

Leor Zolman

I don't think so. I've never written source like that. I don't think I'd
recognize it especially if it's classic k&r.

Just a shot in the dark. That's about the only declaration-related place I
could think of that something structured like that /might/ be legal...
-leor

Leor Zolman
BD Software
(e-mail address removed)
www.bdsoft.com -- On-Site Training in C/C++, Java, Perl & Unix
C++ users: Download BD Software's free STL Error Message
Decryptor at www.bdsoft.com/tools/stlfilt.html
 
D

Dan Pop

In said:
I think I have a standard question here. ISO or ANSI.

Nope, you don't. You have a plain C question and any decent C book
provides the answer.
Some of the developers
on this site have shown me code in this form

int name(int x,y);

Now my compiler just will not accept that. It has to be
int name (int x,int y);

Is my compiler a C99 compiler?

Dunno. All I know for sure is that you're too lazy to bother opening a
C book before posting here.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top