title: Expression must be a modifiable lvalue pointer-to-char parameter
body: <p>This is the whole code. Upon compiling I get the error below:</p>
  
  <blockquote>
    <p>error LNK2019: unresolved external symbol "void __cdecl CandyBarFunc(struct CandyBar &amp;,char const *,double,int)" (?CandyBarFunc@@YAXAAUCandyBar@@PBDNH@Z) referenced in function _wmain</p>
    
    <p>fatal error LNK1120: 1 unresolved
    externals</p>
  </blockquote>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  using namespace std;
  
  struct CandyBar
  {
      char name[40];
      double weight;
      int calories;
  };
  
  void CandyBarFunc(CandyBar &amp; astruct, const char * aname = "Millennium Munch", double aweight = 2.85, int acalories = 350);
  void CandyBarFunc(const CandyBar &amp; astruct);
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      CandyBar MyCandyBar;
      CandyBarFunc(MyCandyBar, "Hello World Candy Bar", 1.25, 200);
      CandyBarFunc(MyCandyBar);
      return 0;
  }
  
  void CandyBarFunc(CandyBar &amp; astruct, char * aname, double aweight, int acalories)
  {
      strncpy(astruct.name,aname,40);
      astruct.weight = aweight;
      astruct.calories = acalories;
  }
  
  void CandyBarFunc(const CandyBar &amp; astruct)
  {
      cout &lt;&lt; "Name: " &lt;&lt; astruct.name &lt;&lt; endl;
      cout &lt;&lt; "Weight: " &lt;&lt; astruct.weight &lt;&lt; endl;
      cout &lt;&lt; "Calories: " &lt;&lt; astruct.calories;
  }
  </code></pre>