By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,710 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

typedef struct foo{} foo

P: 41
Hi!
I was just wondering what this means (in c++):
Expand|Select|Wrap|Line Numbers
  1. typedef struct foo{} foo;
  2.  
is it some way of prototyping a function as a struct, or an array as a struct or something?
I found it in a header im using, with it im using a .lib and a .dll, so i don't known what whats really going on, but i'd like to know what the above means.
Thanks.
- Jon
Aug 4 '07 #1
Share this Question
Share on Google+
2 Replies


P: 41
is it maybe the same as a class prototype?
Expand|Select|Wrap|Line Numbers
  1. class foo;
  2.  
Aug 4 '07 #2

Expert 10K+
P: 11,448
Hi!
I was just wondering what this means (in c++):
Expand|Select|Wrap|Line Numbers
  1. typedef struct foo{} foo;
  2.  
It simply defines another name 'foo' for an empty struct which, incidentally, has
the same name 'foo] as its struct tag but that's irrelevant.

kind regards,

Jos
Aug 4 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.