Title: | C++ |
Notice: | Read 1.* and use keywords (e.g. SHOW KEY/FULL KIT_CXX_VAX_VMS) |
Moderator: | DECCXX::AMARTIN |
Created: | Fri Nov 06 1987 |
Last Modified: | Thu Jun 05 1997 |
Last Successful Update: | Fri Jun 06 1997 |
Number of topics: | 3604 |
Total number of notes: | 18242 |
I'm getting a "Missing ;" error when compiling the following code using DEC C++ V5.5-017 on OpenVMS ALPHA V7.1: #define L_CHAR L main() { const wchar_t buf[] = L_CHAR"abc"; } The preprocessed output (using /PREPROCESS_ONLY) shows that a whitespace is being inserted between the L and the string "abc" which causes the error. $ cxx test /preproc=sys$output: # 1 "WORK1:[DANTONI]TEST.CXX;6" main() { const wchar_t buf[] = L "abc"; } Is there some way to do this substitution without getting the whitespace?
T.R | Title | User | Personal Name | Date | Lines |
---|---|---|---|---|---|
3478.1 | ## | DECCXL::WIBECAN | That's the way it is, in Engineering! | Fri Mar 07 1997 13:39 | 7 |
You could do this: #define L_STRING(x) L ## x const wchar_t buf[] = L_STRING("abc"); Note the use of the token pasting operator "##" in the macro definition. | |||||
3478.2 | Fixed | STAR::DANTONI | Fri Mar 07 1997 15:48 | 1 | |
Thanks. This syntax fixed the problem. |