Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > Help with a #define?

Reply
Thread Tools

Help with a #define?

 
 
Martin De Kauwe
Guest
Posts: n/a
 
      02-14-2011
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)
 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      02-14-2011
On 02/15/11 12:36 PM, Martin De Kauwe wrote:
> 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!

--
Ian Collins
 
Reply With Quote
 
 
 
 
Martin De Kauwe
Guest
Posts: n/a
 
      02-15-2011
On Feb 15, 10:44*am, Ian Collins <(E-Mail Removed)> wrote:
> On 02/15/11 12:36 PM, Martin De Kauwe wrote:
>
> > 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!
>
> --
> 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!
 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      02-15-2011
On 02/15/11 07:02 PM, Martin De Kauwe wrote:
> On Feb 15, 10:44 am, Ian Collins<(E-Mail Removed)> wrote:
>> On 02/15/11 12:36 PM, Martin De Kauwe wrote:
>>
>>> 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!


> 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!

--
Ian Collins
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help Help Help Pentax S5i Help needed (Please) The Martian Digital Photography 14 06-20-2008 07:56 AM
HELP - HELP - HELP =?Utf-8?B?S2ltb24gSWZhbnRpZGlz?= ASP .Net 4 03-09-2006 12:46 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 1 07-16-2004 01:12 PM
HELP WANTED HELP WANTED HELP WANTED Harvey ASP .Net 0 07-16-2004 10:00 AM
HELP! HELP! HELP! Opening Web Application Project Error =?Utf-8?B?dHJlbGxvdzQyMg==?= ASP .Net 0 02-20-2004 05:16 PM



Advertisments