Solved.

F

Frédéric Kpama

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

Seebs

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
 
F

Frédéric Kpama

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
 
K

Keith Thompson

Frédéric Kpama said:
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.

[...]
 
S

Seebs

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top