Help with a #define?

M

Martin De Kauwe

Hi,

I am trying to translate some c++ code and have run into an expression
which makes no sense to me? I have a C background so understand the
#define, but not what the use of the double ## means, e.g. x##n?

Any assistance would be much appreciated...

#define NCLIMIT(x,mn,mx) x##n += nclimit (x, x##n, mn, mx)
 
I

Ian Collins

Hi,

I am trying to translate some c++ code and have run into an expression
which makes no sense to me? I have a C background so understand the
#define, but not what the use of the double ## means, e.g. x##n?

Any assistance would be much appreciated...

It's bizarre how often this gets asked, look up concatenation (or even
##) in your trusty copy of K&R. It's also the first item in the index
of The C++ programming language!
 
M

Martin De Kauwe

It's bizarre how often this gets asked, look up concatenation (or even
##) in your trusty copy of K&R.  It's also the first item in the index
of The C++ programming language!

Hi,

thanks as you say it is right there in K&R! I guess instead of looking
in the book I tried googling and well not an easy keyword to find it
seems!
 
I

Ian Collins

Hi,

thanks as you say it is right there in K&R! I guess instead of looking
in the book I tried googling and well not an easy keyword to find it
seems!

You still can't beat the printed word!
 

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,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top