Solved.

Discussion in 'C Programming' started by Frédéric Kpama, Dec 24, 2011.

  1. Thank you both for the quick reply.

    Ok "Stars and Midnight China Blue" 's response worked for me. Thanks a
    lot. Is it a really "portable" solution ? I mean, can i say that every
    compiler won't complain on this?

    Why can we "use" a struct without declaration and not a "custom type"?
    Is it a standard?
     
    Frédéric Kpama, Dec 24, 2011
    #1
    1. Advertising

  2. Frédéric Kpama

    Seebs Guest

    On 2011-12-24, Fr?d?ric Kpama <> wrote:
    > Ok "Stars and Midnight China Blue" 's response worked for me. Thanks a
    > lot. Is it a really "portable" solution ? I mean, can i say that every
    > compiler won't complain on this?


    It's impossible to say since you didn't quote or provide any context.

    > Why can we "use" a struct without declaration


    I'm not sure why "use" is in quotes here. You can't use a struct without
    declaration. However, you can use a *pointer to* an incomplete type. So
    you can forward-declare a struct, that makes an incomplete type, then you
    can make and manipulate pointers to it. You can't dereference them, but
    they're usable as types for arguments and the like.

    -s
    --
    Copyright 2011, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
    I am not speaking for my employer, although they do rent some of my opinions.
     
    Seebs, Dec 24, 2011
    #2
    1. Advertising

  3. On 24 déc, 09:34, Seebs <> wrote:
    > On 2011-12-24, Fr?d?ric Kpama <> wrote:
    >
    > > Ok "Stars and Midnight China Blue" 's response worked for me. Thanks a
    > > lot. Is it a really "portable" solution ? I mean, can i say that every
    > > compiler won't complain on this?

    >
    > It's impossible to say since you didn't quote or provide any context.


    I was asking in general.

    > You can't use a struct without declaration.  However, you can use a *pointer to* an incomplete type.  So you can forward-declare a struct, that makes an incomplete type, then you can make and manipulate pointers to it.  You can't dereference them, but they're usable as types for arguments and the like.


    Ok thanks for the answer.

    Cheers
     
    Frédéric Kpama, Dec 24, 2011
    #3
  4. Frédéric Kpama <> writes:
    > Thank you both for the quick reply.


    Quick reply to what?

    Your article has no Reference: header, and its subject doesn't refer to
    any previous article.

    If you want to post a followup, post it as a followup, and quote enough
    text from the article to which you're replying to make the context
    reasonably clear.

    [...]

    --
    Keith Thompson (The_Other_Keith) <http://www.ghoti.net/~kst>
    Will write code for food.
    "We must do something. This is something. Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"
     
    Keith Thompson, Dec 24, 2011
    #4
  5. Frédéric Kpama

    Seebs Guest

    On 2011-12-24, Fr?d?ric Kpama <> wrote:
    > On 24 d?c, 09:34, Seebs <> wrote:
    >> On 2011-12-24, Fr?d?ric Kpama <> wrote:
    >>
    >> > Ok "Stars and Midnight China Blue" 's response worked for me. Thanks a
    >> > lot. Is it a really "portable" solution ? I mean, can i say that every
    >> > compiler won't complain on this?


    >> It's impossible to say since you didn't quote or provide any context.


    > I was asking in general.


    The problem is that you asked:
    Is it really a "portable" solution?
    but there was nothing for us to refer back to as "it". You need to include
    context if you're going to use pronouns.

    -s
    --
    Copyright 2011, all wrongs reversed. Peter Seebach /
    http://www.seebs.net/log/ <-- lawsuits, religion, and funny pictures
    http://en.wikipedia.org/wiki/Fair_Game_(Scientology) <-- get educated!
    I am not speaking for my employer, although they do rent some of my opinions.
     
    Seebs, Dec 24, 2011
    #5
    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. pfurb
    Replies:
    0
    Views:
    548
    pfurb
    Jan 21, 2004
  2. CM
    Replies:
    4
    Views:
    427
    O.S. de Zwart, endforward
    Jul 2, 2003
  3. Mark MacRae
    Replies:
    1
    Views:
    451
  4. George Morrone

    Problem solved - sort of

    George Morrone, Aug 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    590
    Jacob Yang [MSFT]
    Aug 18, 2003
  5. Michael Bacarella
    Replies:
    26
    Views:
    1,420
    harri
    Nov 20, 2007
Loading...

Share This Page