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

help me to understand the declaration as well as the reason

P: 62
Hi I am having a problem using typedef

what does these declaration mean?

typedef gtb(string_t, tt_type_enum) tt_type_table( &stringless, &stringequals );
typedef gtb(string_t,tt_qual_enum) tt_qual_table( &stringless, &stringequals);

where gtb is a macro
#define gtb(key_type,value_type) name3(value_type,tb,key_type)
#define name3(a,b,c) _name3_aux(a,b,c)
#define _name3_aux(a,b,c) a##b##c
'#" is for concatenation

string_t is pointer to class string_rec
tt_type_enum is of type enum

stringless is (int stringless(tb__item_t a, tb__item_t b))
stringeuals is (int stringequals(tb__item_t a, tb__item_t b))

when i am using the first declarations in my code I am getting error
syntax error before `(' token, for both typedefs.

help me to understand the declaration as well as the reason

for the syntax error..

regards

srikar
Sep 21 '06 #1
Share this Question
Share on Google+
2 Replies


P: 62
any one suggest me
Sep 22 '06 #2

Banfa
Expert Mod 5K+
P: 8,916
It is very confusing

typedef gtb(string_t, tt_type_enum) tt_type_table( &stringless, &stringequals );

when we apply the gtb macro ends up as

typedef tt_type_enumtbstring_t tt_type_table( &stringless, &stringequals );

I think the & are wrong but may be the compiler does care.

Looks like it is may be trying to declare a type that is a pointer to a function that returns tt_type_enumtbstring_t and takes 2 other pointers to functions as parameters.
Sep 22 '06 #3

Post your reply

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