Function definition into main() function.

Discussion in 'C Programming' started by CViniciusM, Feb 27, 2004.

  1. CViniciusM

    CViniciusM Guest

    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.
     
    CViniciusM, Feb 27, 2004
    #1
    1. Advertising

  2. CViniciusM

    nrk Guest

    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
     
    nrk, Feb 27, 2004
    #2
    1. Advertising

  3. 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*!
     
    Martin Ambuhl, Feb 27, 2004
    #3
  4. CViniciusM

    CViniciusM Guest

    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*!
     
    CViniciusM, Feb 28, 2004
    #4
  5. 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
     
    Joona I Palaste, Feb 28, 2004
    #5
  6. (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. \_/
     
    Martin Dickopp, Feb 28, 2004
    #6
  7. CViniciusM

    Dan Pop Guest

    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:
     
    Dan Pop, Mar 1, 2004
    #7
  8. 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
     
    Joona I Palaste, Mar 1, 2004
    #8
  9. CViniciusM

    Dan Pop Guest

    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:
     
    Dan Pop, Mar 2, 2004
    #9
  10. 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
     
    Joona I Palaste, Mar 2, 2004
    #10
  11. CViniciusM

    Dan Pop Guest

    In <c22hps$e1c$> Joona I Palaste <> writes:

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


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

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
     
    Dan Pop, Mar 3, 2004
    #11
  12. Dan Pop <> scribbled the following:
    > In <c22hps$e1c$> Joona I Palaste <> writes:
    >>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.


    > 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? =)

    --
    /-- Joona Palaste () ------------- Finland --------\
    \-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
    "He said: 'I'm not Elvis'. Who else but Elvis could have said that?"
    - ALF
     
    Joona I Palaste, Mar 3, 2004
    #12
  13. CViniciusM

    Richard Bos Guest

    Joona I Palaste <> wrote:

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

    >
    > > 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? =)


    Yes. Repeatedly.

    Richard, barely joking.
     
    Richard Bos, Mar 3, 2004
    #13
  14. CViniciusM

    Dan Pop Guest

    In <c24mlu$ms8$> Joona I Palaste <> writes:

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

    >
    >> 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? =)


    No need: I was repeating myself *on purpose* ;-)

    Dan
    --
    Dan Pop
    DESY Zeuthen, RZ group
    Email:
     
    Dan Pop, Mar 3, 2004
    #14
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jianli Shen
    Replies:
    1
    Views:
    589
    Victor Bazarov
    Mar 13, 2005
  2. CViniciusM

    Function definition into main() function.

    CViniciusM, Feb 27, 2004, in forum: C Programming
    Replies:
    2
    Views:
    739
    Lew Pitcher
    Feb 27, 2004
  3. Ark
    Replies:
    1
    Views:
    418
    Chris Torek
    Aug 7, 2004
  4. Ravi
    Replies:
    17
    Views:
    928
    Kenneth Brody
    Apr 1, 2006
  5. ravi
    Replies:
    28
    Views:
    982
    Richard Heathfield
    Sep 26, 2007
Loading...

Share This Page