C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-10-2009, 06:22 AM   #1
Registered User
 
Join Date: Nov 2009
Posts: 1
"##_##" means

hi all...
i came across one sentence...
can anyone tell me what it means?
#define set(x,y) (x|=x##_##y)
what does that symbol "##_##" means in the code...




with regards
shiva
eshivaprasad is offline   Reply With Quote
Old 11-10-2009, 06:25 AM   #2
Registered User
 
Join Date: Oct 2009
Location: While(1)
Posts: 368
it will concatenate the input values dear
RockyMarrone is offline   Reply With Quote
Old 11-10-2009, 06:47 AM   #3
Jack of many languages
 
Dino's Avatar
 
Join Date: Nov 2007
Location: Katy, Texas
Posts: 2,070
Look in your C book for preprocessor directives, under substituting macro variables.
__________________
Mac and Windows cross platform programmer. Ruby lover.
Dino is offline   Reply With Quote
Old 11-10-2009, 09:28 AM   #4
Registered User
 
rpbear's Avatar
 
Join Date: Nov 2009
Posts: 8
it means if
#define a(x) 1##x
and you ues printf to do this:
printf("%d",a(34));
it'll prodecu 134
rpbear is offline   Reply With Quote
Old 11-10-2009, 09:56 AM   #5
Registered User
 
Join Date: Apr 2006
Posts: 1,312
It's use to concatenate the parameters passed as identifiers. The preprocessor operator here is ##. set(var,feild1) would evaluate to (var|=var_feild1) for example.
__________________
It is too clear and so it is hard to see.
A dunce once searched for fire with a lighted lantern.
Had he known what fire was,
He could have cooked his rice much sooner.
King Mir is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What does this code means? junkeat90 C++ Programming 6 01-14-2008 05:03 AM
can u help me wht this command means cnu_sree C Programming 2 10-27-2007 05:57 AM
what does "close wait" and "fin_wait2" means? hanhao Networking/Device Communication 0 07-18-2005 05:14 AM
Do you know what this compiler error means? Zalbik C++ Programming 2 02-26-2003 04:20 PM
Can someone explain to me what this code means Shadow12345 C++ Programming 3 12-22-2002 12:36 PM


All times are GMT -6. The time now is 04:50 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22