title: passing identifier and type to macro
body: <p>I'm trying to pass an identifier and a type to a macro that should declare the variable </p>
  
  <pre><code>#define DECLARE_PARAM(TYPE, PARAM) \
    TYPE PARAM; \
    gboolean __exist_##PARAM = FALSE
  
  ...
  
  DECLARE_PARAM(char[100], title);
  </code></pre>
  
  <p>but I'm getting compilation errors :</p>
  
  <pre><code>expected identifier or '(' before '[' token
     DECLARE_PARAM(char[100], title);
                       ^
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>It works with simple types such char or int, is there a way I can pass an array type?</p>
  
  <p><strong>CONTEXT</strong></p>
  
  <p>I'm actually trying to make a variadic function that takes a string of parameters name separated by spaces <code>"title color other"</code> and then their values so it would be called like this : </p>
  
  <pre><code>create_window("color title", "blue", "My window");
  </code></pre>
  
  <p>so the function would give <strong>default values</strong> to the none specified argument.</p>
  
  <p>I wrote this as a test, but now I need to put this boilerplate code into a macro like this
  for example : </p>
  
  <pre><code>DEFAULT_PARAM(title, char[100], "My window");
  </code></pre>
  
  <p>here is the test I wrote</p>
  
  <pre><code>#define DECLARE_PARAM(TYPE, PARAM) \
    TYPE PARAM; \
    gboolean __exist_##PARAM = FALSE
  
  GtkWidget *fenetre_creer(char *keys, ...)
  {
    va_list args;
  
    DECLARE_PARAM(char[100], titre);
    DECLARE_PARAM(char[100], icon);
    DECLARE_PARAM(int, padding);
  
    GList *argList = read_args(keys);
    int nombreArguments = g_list_length(argList);
  
    va_start(args, nombreArguments);
  
    GList *iterator = argList;
    while(iterator)
      {
        char *argument = iterator-&gt;data;
        if(strcmp(argument, "titre"))
          {
            strcpy(titre, va_arg(args, char*));
            _titre_param = TRUE;
          }
        else if(strcmp(argument, "icon"))
          {
            strcpy(icon, va_arg(args, char*));
            _icon_param = TRUE;
          }
        else if (strcmp(argument, "padding"))
          {
            padding = va_arg(args, int);
            _padding_param = TRUE;
          }
        iterator = iterator-&gt;next;
      }
    var_end();
  
    if(!__exist_titre)
      strcpy(titre, "Titre de la fenetre");
    if(!__exist_padding)
      padding = 10;
    if(!__exist_icon)
      strcpy(icon, "");
  
    printf("titre : %s\n", titre);
    printf("padding : %d\n", padding);
    printf("icon : %s\n", icon);
  
  }
  </code></pre>