title: C++ - why is this code not working when a macro is used?
body: <p>When I use the <code>a-&gt;url</code> inside a macro then it's failing, but when I replace <code>a-&gt;url</code> and put the string in manually it works. How do I make <code>a-&gt;url</code> compatible with the macro?</p>
  
  <pre><code>g++    -c -g -std=c++11 -MMD -MP -MF "build/Debug/GNU-MacOSX/main.o.d" -o build/Debug/GNU-MacOSX/main.o main.cpp
  main.cpp:18:35: error: expected ';' after expression
    cout &lt;&lt; MANIFEST_URL(a-&gt;url);
  </code></pre>
  
  <p>CODE:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;ctime&gt;
  #include &lt;string&gt;
  using namespace std;
  
  #define MANIFEST_URL(REPLACE) "https://" REPLACE "/manifest.json";
  
  typedef struct custom {
    char *id;
    string url;  
    custom *next;   
  } custom;
  
  int main() {  
    custom *a;
    a = new custom;
    a-&gt;url = "www.google.com";  
    cout &lt;&lt; MANIFEST_URL(a-&gt;url);
    cout &lt;&lt; a-&gt;url;  
    return 0;  
  }
  </code></pre>