Function definition into main() function.

C

CViniciusM

Hello,

Does the code below obey the ISO/IEC 9899:1999 Standard?

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int a = 10;

void print()
{
printf("a = %d\n\n", a);
}

print();

return 0;
}

Thanks in advance, Vinicius.
 
N

nrk

CViniciusM said:
Hello,

Does the code below obey the ISO/IEC 9899:1999 Standard?

#include <stdio.h>
#include <stdlib.h>

int main(void)
{
int a = 10;

void print()
{
printf("a = %d\n\n", a);
}

print();

return 0;
}

Thanks in advance, Vinicius.

This is not instant messaging. You have to wait to get answers before
re-posting your question. On my news server, I can see that your question
has already been answered - more than once. Here's the answer once more:

No. C does not allow nested function definitions.

-nrk.
 
M

Martin Ambuhl

CViniciusM said:
Hello,

Does the code below obey the ISO/IEC 9899:1999 Standard?

An hour and a half _before_ you reposted this, Joona Plaste and Lew
Pitcher answered you. Didn't you like their answer, or do you not
bother to check the newsgroup for answers?

Just in case the last is true (even though absurd) I have e-mailed this
as well.

BTW: the answer is still *NO*!
 
C

CViniciusM

I wrote wrong, "Is the code below..." instead of "Does the code
below". Excuse me for the bad english.

[]´s.
 
J

Joona I Palaste

An hour and a half _before_ you reposted this, Joona Plaste and Lew
Pitcher answered you. Didn't you like their answer, or do you not
bother to check the newsgroup for answers?

Palaste, not Plaste.
 
M

Martin Dickopp

I wrote wrong, "Is the code below..." instead of "Does the code
below". Excuse me for the bad english.

Please don't top-post. Corrected.

Posting the whole question again is not the right way to correct errors.
If you must correct an error, post a *small* followup message which
points out what was wrong.

In this case, however, there was no need for a correction at all. As you
can see from the replies to your first posting, people understood your
question despite the grammar mistake.

Martin
 
D

Dan Pop

In said:
Palaste, not Plaste.

Have I ever told you that you have an ego problem?

Even if it affects your name, a typo is still a typo and not worth
posting a reply for the *sole* reason of correcting it. If you managed
(or even attempted) to derive some humour from it (e.g. via a clever pun)
things would be different...

Dan
 
J

Joona I Palaste

Have I ever told you that you have an ego problem?
Even if it affects your name, a typo is still a typo and not worth
posting a reply for the *sole* reason of correcting it. If you managed
(or even attempted) to derive some humour from it (e.g. via a clever pun)
things would be different...

Only Dan Pop would ever make such a huge deal about a typo correction...
 
J

Joona I Palaste

Have I ever told you before that you're humour impaired? ;-)

Have *I* ever told *you* that you keep on saying the same things over
and over again? =)
 
R

Richard Bos

Joona I Palaste said:
Have *I* ever told *you* that you keep on saying the same things over
and over again? =)

Yes. Repeatedly.

Richard, barely joking.
 

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,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top