error: pasting “.” and “red” does not give a valid preprocessing token

. separates tokens and so you can’t use ## as .red is not a valid token. You would only use ## if you were concatenating two tokens into a single one.

This works:

#define X(a, b) foo.a = -1;

What’s a valid proprocessing token? Can someone explain this?

It is what gets parsed/lexed. foo.bar would be parsed as 3 tokens (two identifiers and an operator): foo . bar If you use ## you would get only 2 tokens (one identifier and one invalid token): foo .bar

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)