Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Function definition into main() function.

Reply
Thread Tools

Function definition into main() function.

 
 
CViniciusM
Guest
Posts: n/a
 
      02-27-2004
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.
 
Reply With Quote
 
 
 
 
nrk
Guest
Posts: n/a
 
      02-27-2004
CViniciusM wrote:

> 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.

--
Remove devnull for email
 
Reply With Quote
 
 
 
 
Martin Ambuhl
Guest
Posts: n/a
 
      02-27-2004
CViniciusM wrote:

> 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*!
 
Reply With Quote
 
CViniciusM
Guest
Posts: n/a
 
      02-28-2004
I wrote wrong, "Is the code below..." instead of "Does the code
below". Excuse me for the bad english.

[]īs.

Martin Ambuhl <> wrote in message news:<>...
> CViniciusM wrote:
>
> > 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*!

 
Reply With Quote
 
Joona I Palaste
Guest
Posts: n/a
 
      02-28-2004
Martin Ambuhl <> scribbled the following:
> CViniciusM wrote:
>> 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?


Palaste, not Plaste.

--
/-- Joona Palaste () ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"Last year he disrespected me - and then he showed lack of respect."
- Anthony Mason
 
Reply With Quote
 
Martin Dickopp
Guest
Posts: n/a
 
      02-28-2004
(CViniciusM) writes:

> Martin Ambuhl <> wrote in message news:<>...
>> CViniciusM wrote:
>>
>> > 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.

>
> 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


--
,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =.
/ ,- ) http://www.zero-based.org/ ((_/)o o(\_))
\ `-' `-'(. .)`-'
`-. Debian, a variant of the GNU operating system. \_/
 
Reply With Quote
 
Dan Pop
Guest
Posts: n/a
 
      03-01-2004
In <c1pl4c$5no$> Joona I Palaste <> writes:

>Martin Ambuhl <> scribbled the following:
>> CViniciusM wrote:
>>> 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?

>
>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
--
Dan Pop
DESY Zeuthen, RZ group
Email:
 
Reply With Quote
 
Joona I Palaste
Guest
Posts: n/a
 
      03-01-2004
Dan Pop <> scribbled the following:
> In <c1pl4c$5no$> Joona I Palaste <> writes:
>>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...


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

--
/-- Joona Palaste () ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"You will be given the plague."
- Montgomery Burns
 
Reply With Quote
 
Dan Pop
Guest
Posts: n/a
 
      03-02-2004
In <c1vojt$lub$> Joona I Palaste <> writes:

>Dan Pop <> scribbled the following:
>> In <c1pl4c$5no$> Joona I Palaste <> writes:
>>>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...

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


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

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email:
 
Reply With Quote
 
Joona I Palaste
Guest
Posts: n/a
 
      03-02-2004
Dan Pop <> scribbled the following:
> In <c1vojt$lub$> Joona I Palaste <> writes:
>>Dan Pop <> scribbled the following:
>>> In <c1pl4c$5no$> Joona I Palaste <> writes:
>>>>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...

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


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


Yes, you have. You know what? I don't give a damn.

--
/-- Joona Palaste () ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"It was, er, quite bookish."
- Horace Boothroyd
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time template list definition / Run-time variable type definition Pierre Yves C++ 2 01-10-2008 02:52 PM
Automagic determination of definition based on definition location. Jon Slaughter C++ 4 10-26-2005 05:00 PM
can a class definition inside another class's definition Jianli Shen C++ 1 03-13-2005 06:02 PM
help?: incomplete definition with complete definition in scope Ark C Programming 1 08-07-2004 04:21 PM
Function definition into main() function. CViniciusM C Programming 2 02-27-2004 03:39 PM



Advertisments