Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in C only
Search
Advanced Search
Forums
BYTES
Product Launch
Updates
Developer Toolkit
Today's Posts
Member List
Calendar
Home
Forum
Topic
C
What does this mean?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
RedSon
Recognized Expert
Expert
Join Date:
Jan 2007
Posts:
4980
#1
What does this mean?
Feb 11 '08, 10:52 PM
#define _AFX_FUNCNAME(_ Name) _Name##W
Whats the ##W part of that?
gpraghuram
Recognized Expert
Top Contributor
Join Date:
Mar 2007
Posts:
1275
#2
Feb 12 '08, 01:08 AM
Originally posted by
RedSon
#define _AFX_FUNCNAME(_ Name) _Name##W
Whats the ##W part of that?
##W concatenates the W with the value passed to the #define.
Change theW to _Name and print the value like this
[code=c]
#define _AFX_FUNCNAME(_ Name) _Name##_Name
printf("%s\n",_ AFX_FUNCNAME("t est"));
[/code]
Raghuram
Comment
Post
Cancel
RedSon
Recognized Expert
Expert
Join Date:
Jan 2007
Posts:
4980
#3
Feb 12 '08, 04:46 AM
Originally posted by
gpraghuram
##W concatenates the W with the value passed to the #define.
Change theW to _Name and print the value like this
[code=c]
#define _AFX_FUNCNAME(_ Name) _Name##_Name
printf("%s\n",_ AFX_FUNCNAME("t est"));
[/code]
Raghuram
So the output would be "_Nametest_Name "?
Comment
Post
Cancel
gpraghuram
Recognized Expert
Top Contributor
Join Date:
Mar 2007
Posts:
1275
#4
Feb 12 '08, 09:01 AM
Originally posted by
RedSon
So the output would be "_Nametest_Name "?
No i got a different output like "testtest"
Raghuram
Comment
Post
Cancel
weaknessforcats
Recognized Expert
Expert
Join Date:
Mar 2007
Posts:
9214
#5
Feb 12 '08, 06:03 PM
Read up on the preprocessor
token-pasting
operator.
This is replaced in C++ with templates.
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment