473,385 Members | 1,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

#define macros

Hi all,

i'm currently working on some code and i have found macro definitions
that i have never seen before. can anyone help me and tell me what
they mean?

#define IPCV_MORPHOLOGY_PTRS( morphtype, flavor ) \
icv##morphtype##Rect_##flavor##_C1R_t \
icv##morphtype##Rect_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_##flavor##_C3R_t \
icv##morphtype##Rect_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_##flavor##_C4R_t \
icv##morphtype##Rect_##flavor##_C4R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_p = 0; \
\
icv##morphtype##_##flavor##_C1R_t \
icv##morphtype##_##flavor##_C1R_p = 0; \
icv##morphtype##_##flavor##_C3R_t \
icv##morphtype##_##flavor##_C3R_p = 0; \
icv##morphtype##_##flavor##_C4R_t \
icv##morphtype##_##flavor##_C4R_p = 0;

I looked in some books and googled for such definitions but didn't
find anything about such "double dashs" (##). Does anyone know a
resource to find a description?

Thanks!
Frank

Apr 11 '07 #1
2 1464
fr******@gmx.net wrote:
i'm currently working on some code and i have found macro definitions
that i have never seen before. can anyone help me and tell me what
they mean?

#define IPCV_MORPHOLOGY_PTRS( morphtype, flavor ) \
icv##morphtype##Rect_##flavor##_C1R_t \
icv##morphtype##Rect_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C1R_p = 0; \
icv##morphtype##Rect_##flavor##_C3R_t \
icv##morphtype##Rect_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C3R_p = 0; \
icv##morphtype##Rect_##flavor##_C4R_t \
icv##morphtype##Rect_##flavor##_C4R_p = 0; \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_t \
icv##morphtype##Rect_GetBufSize_##flavor##_C4R_p = 0; \
\
icv##morphtype##_##flavor##_C1R_t \
icv##morphtype##_##flavor##_C1R_p = 0; \
icv##morphtype##_##flavor##_C3R_t \
icv##morphtype##_##flavor##_C3R_p = 0; \
icv##morphtype##_##flavor##_C4R_t \
icv##morphtype##_##flavor##_C4R_p = 0;

I looked in some books and googled for such definitions but didn't
find anything about such "double dashs" (##). Does anyone know a
resource to find a description?
Look for "token concatenation operator". Essentially it constructs
a new preprocessor token out of its left and right operands. IOW,
A ## B becomes AB.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Apr 11 '07 #2

Hey Victor!

thanks for your quick reply! I found some stuff under "token
concatenation operator.

Cheers,
Frank

Apr 11 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

97
by: s | last post by:
Can I do this: #define MYSTRING "ABC" .. .. .. char mychar = MYSTRING; .. .. ..
14
by: Carl Ribbegaardh | last post by:
What other c++ constructs can I use instead of #define for executing a couple of functions? Example: #define DO_STUFF doThis(); doThat(); I'd guess that I can either use a template function,...
19
by: Robert | last post by:
Greetings everyone, I was wondering if a const variable or object took up space. I know that a #define'd macro doesn't, as it's basically just interpreted by the compiler. If a const does take...
14
by: Rajan | last post by:
Hi All C++ Experts (1)I want have a simple suggestion from u all experts which is preferable const or #define and in which cases (2)in my project i want to avoid hardcoding , for that i have...
6
by: msigwald | last post by:
The following line of code works, however, since my professor is a real purist of c, I would like to know if this code is valid (is it good code or a piece of crap?): #define DMP_FILE argv ...
10
by: O Plameras | last post by:
Are there differences in terms of functionality of, #define and typedef ? By the above I mean any instance when the outcome obtained by running two versions (1) and (2) below of C codes...
7
by: aaragon | last post by:
Hi everyone, I have a simple question. I'm trying to make a macro in one file so I can use it in main.cpp. The idea is that I the user of my code has simple to type the macro definition to replace...
6
by: anirbid.banerjee | last post by:
Hi, I need to write a macro which would have a lot many conditional #ifdef ... #endif blocks in it. #define _xx_macro (x) { ... \ ... \ /* some code (); */ #ifdef _SOME_STMT \ ... \ ... \
6
by: raghu | last post by:
#define GOOGLE int main(void) { printf("%d",GOOGLE); return 0; } In the above program ,by default GOOGLE should be assigned to zero..right? But when I try to print it it gives an error at...
28
by: ravi | last post by:
Hello everybody, I am writing a small application which does some work before the user main function starts execution. I am trying to #define the main function. But the problem is that,
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.