Assigning map to char*.. how does this work? (Code-sample included)

  c++, variadic-functions

I’m trying to work with some existing code and I came across this code that I don’t quite understand how it works:

char *c_token = R(
{
  "1":"abcdef",
  "2":"ghijkl",
  "3":"mnopqr",
  "4":"stuvwx"
});

Where R() is defined as:

#define R(...) #__VA_ARGS__

What does the c_token buffer look like after this? Is there any advantage to doing this over just assigning a map<string,string>? I am trying to read the code but I honestly don’t understand what this is doing.

Assuming this was used to pass this map in, how would you translate this back into a map on the other end?

Source: Windows Questions C++

LEAVE A COMMENT