11-04-2013 04:11 AM
CVI2013 with f1 gives build error for preprocessor ## directive (token concatenation).
See attachment
Solved! Go to Solution.
11-14-2013 12:12 PM
11-15-2013 01:02 AM
I don't understand what you mean with that link, sorry.
Could you explain it, please?
11-15-2013 10:31 AM
You are wrongly using the ## operator.
The ## operator is called also "token pasting operator" and its purpose is to tell to C preprocessor to concatenate two tokens.
You want simply to concatenate two strings: you don't need any special operator:
#define LocalDir "E:\\" SharedDir // define
11-28-2013 06:19 AM
Now I understand what you mean, and I tried that your suggestion works in CVI 2013
#define str1 "abcd" #define str2 "efgh" #define concatenated_string str1 str2 //using a space character between the 2 strings
I don't know why ## has been working for string concatenation since CVI 6.0 to CVI 2012 SP1 ![]()
I've been using it since years (I supposed that a string is a simple token, but probably it isn't)
11-28-2013 09:25 AM
Hi
Keep in mind that this is a general feature of string literals, and not something related to preprocessor directives, so you could, for example, write something like this:
printf("this "
"is "
"a single "
"long "
"string");