Error Pasting
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack copy and paste error Overflow the company Business Learn more about hiring developers or posting ads with us copy and paste error messages Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a
Copy And Paste Error In Excel
community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error: pasting “.” and “red” does not give a valid preprocessing token up vote 15
Copy Paste Error Windows 7
down vote favorite 1 I'm implementing The X macro, but I have a problem with a simple macro expansion. This macro (see below) is used into several macros usage examples, by including in this article. The compiler gives an error message, but I can see valid C code by using -E flag with the GCC compiler. The macro X-list is defined as the following: #define LIST \ X(red, "red") \ X(blue, excel paste error too many different cell formats "blue") \ X(yellow, "yellow") And then: #define X(a, b) foo.##a = -1; LIST; #undef X But the gcc given the following errors messages: lixo.c:42:1: error: pasting "." and "red" does not give a valid preprocessing token lixo.c:42:1: error: pasting "." and "blue" does not give a valid preprocessing token lixo.c:42:1: error: pasting "." and "yellow" does not give a valid preprocessing token Like I said, I can seen valid C code by using -E switch on gcc: lixo.c:42:1: error: pasting "." and "red" does not give a valid preprocessing token lixo.c:42:1: error: pasting "." and "blue" does not give a valid preprocessing token lixo.c:42:1: error: pasting "." and "yellow" does not give a valid preprocessing token foo.red = -1; foo.blue = -1; foo.yellow = -1;; What's a valid preprocessing token? Can someone explain this? (before you say "why not just an either initialize or memset()?" it's not my real code.) c macros c-preprocessor share|improve this question edited Nov 4 '12 at 6:04 Jonathan Leffler 439k62509823 asked Nov 4 '12 at 5:55 Jack 5,9691878146 add a comment| 1 Answer 1 active oldest votes up vote 26 down vote accepted . separates tokens and so you can't use ## as .red is not a valid token. You would only use ## if y
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings
Excel Copy And Paste Area Not The Same Size
and policies of this site About Us Learn more about Stack Overflow c macro concatenate the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation ## in c macro Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; http://stackoverflow.com/questions/13216423/error-pasting-and-red-does-not-give-a-valid-preprocessing-token it only takes a minute: Sign up Error pasting “”HELLO“” and “”WORLD“” does not give a valid preprocessing token up vote 5 down vote favorite This is the faulty code #include
here for a quick overview of the site Help Center Detailed answers to any questions http://stackoverflow.com/questions/18542088/error-pasting-java-com-my-packagename-myclass-mymethod-and-does-not-give you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is paste error a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up error: pasting “Java_com_my_packagename_myClass_myMethod” and “(” does not give a valid preprocessing token up vote 0 down vote favorite I'm writing a macro to make life easier by generating JNI method names, using copy and paste the preprocessor: #define JNI_WRAPPER_METHOD (className, methodName, returnValue, PARAMS) \ JNIEXPORT returnValue JNICALL Java_com_my_packagename_className_methodName\ (JNIEnv *env, jobject obj, BOOST_PP_SEQ_ENUM(PARAMS)) so, ideally this: JNI_WRAPPER_METHOD(myClass, myMethod, jint, (jint myInt)(jstring myString)) would translate to this: JNIEXPORT jint JNICALL Java_com_my_packagename_myClass_myMethod(JNIEnv *env, jobject obj, jint myInt, jstring myString) However, the compiler throws the following error when I attempt to use my macro: error: pasting "Java_com_my_packagename_myClass_myMethod" and "(" does not give a valid preprocessing token Does anyone know why the macro fails? c++ boost precompiler share|improve this question asked Aug 30 '13 at 22:02 MM. 1,75111841 Please learn about the ## preprocessor concatenation operator. Or, if you want anything remotely sane, just avoid the preprocessor altogether. –syam Aug 30 '13 at 22:09 I'm surprised it complained about pasting "Java_com_my_packagename_myClass_myMethod" and "(", since you don't have a token-pasting operator in your macro definition. Are you sure that's the exact code that produced that message? –Keith Thompson Aug 30 '13 at 2