title: Code works fine in visual studio, but when transferred over to Unix I receive errors?
body: <p>Not sure why Unix doesn't like my code for whatever reason, the code works perfectly on Visual Studio, I need to hand in a assignment by using a shell client, and when I try to do that I receive these errors. I am also sorry if this isn't the best question, I am just really confused about why this isn't working. Here are the errors:</p>
  
  <pre><code>w6_in_lab.cpp: In function âint main()â:
  w6_in_lab.cpp:22:11: error: no match for âoperator=â in âA = B.sict::Account::operator+(C)â
  w6_in_lab.cpp:22:11: note: candidates are:
  Account.h:15:12: note: sict::Account&amp; sict::Account::operator=(sict::Account&amp;)
  Account.h:15:12: note:   no known conversion for argument 1 from âsict::Accountâ to âsict::Account&amp;â
  Account.h:17:9: note: char* sict::Account::operator=(char*)
  Account.h:17:9: note:   no known conversion for argument 1 from âsict::Accountâ to âchar*â
  w6_in_lab.cpp:23:7: warning: deprecated conversion from string constant to âchar*â [-Wwrite-strings]
  w6_in_lab.cpp:25:10: error: no match for âoperator=â in âA = B.sict::Account::operator+=((* &amp; C))â
  w6_in_lab.cpp:25:10: note: candidates are:
  Account.h:15:12: note: sict::Account&amp; sict::Account::operator=(sict::Account&amp;)
  Account.h:15:12: note:   no known conversion for argument 1 from âsict::Accountâ to âsict::Account&amp;â
  Account.h:17:9: note: char* sict::Account::operator=(char*)
  Account.h:17:9: note:   no known conversion for argument 1 from âsict::Accountâ to âchar*â
  </code></pre>
  
  <p>I am not familiar with any of these errors as I am not very familiar with doing overloaded operators, and I never use Unix to do C++ assignments.</p>
  
  <p>Here is the .h file:</p>
  
  <pre><code>#ifndef SICT_ACCOUNT_H__
  #define SICT_ACCOUNT_H__
  #include &lt;iostream&gt;
  #include &lt;cstring&gt;
  #include &lt;iomanip&gt;
  namespace sict{
      class Account{
          char _name[41];
          double _balance;
      public:
          Account();
          Account(double balance);
          Account(const char name[], double balance);
          Account(const char name[]);
          Account&amp; operator=(Account&amp; ls);
          Account operator+=(Account&amp; ls);
          char* operator=(char* ls);
          void display()const;
          double getBal();
          char* getName();
  
          friend double operator+=(double&amp; ls, Account&amp; rs);
          Account operator+(Account ls);
  
      };
  
      std::ostream&amp; operator&lt;&lt;(std::ostream&amp; ls, Account&amp; rs);
  };
  
  #endif
  </code></pre>
  
  <p>The .cpp file:</p>
  
  <pre><code>#define _CRT_SECURE_NO_WARNINGS
  #include &lt;cstring&gt;
  #include &lt;iomanip&gt;
  #include "Account.h"
  using namespace std;
  namespace sict{
      Account::Account(){
          _name[0] = 0;
          _balance = 0;
      }
  
      Account::Account(double balance){
          _name[0] = 0;
          _balance = balance;
      }
  
      Account::Account(const char name[], double balance){
          strncpy(_name, name, 40);
          _name[40] = 0;
          _balance = balance;
      }
  
      void Account::display()const{
  
          for(int x = 0; x &lt; 40; x++){
              if(_name[x] == '\0')
                  x = 40;
              else
                  cout &lt;&lt; _name[x];
          }
  
      cout &lt;&lt; ": $" &lt;&lt; setprecision(2) &lt;&lt; fixed &lt;&lt; _balance;
  
      }
  
      Account Account::operator+(Account ls) {
  
          return ls._balance + _balance;
      }
  
      double operator+=(double&amp; ls, Account&amp; rs){
          //cout &lt;&lt; ls &lt;&lt; endl;
          //cout &lt;&lt; rs._balance+ ls &lt;&lt; endl;
          return ls+=rs._balance;
  
  
  
          //return rs._balance+=ls;
      }
  
      Account Account::operator+=(Account&amp; ls){
  
          return  _balance+=ls._balance;
  
      }
  
      Account::Account(const char name[]){
          strncpy(_name, name, 40);
      }
  
      char* Account::getName(){
  
          return _name;
      }
  
      double Account::getBal(){
  
          return _balance;
      }
  
      std::ostream&amp; operator&lt;&lt;(std::ostream&amp; ls, Account&amp; rs){
          rs.display();
          return ls;
      }
  
      Account&amp; Account::operator=(Account&amp; ls){
          if( !strcmp(ls._name,"") &amp;&amp;ls._balance &gt; 0)
          {
              strcpy(_name, "Saving");
          }
  
          _balance = ls._balance;
          //strcpy(_name, ls._name);
  
          return *this;
  
      }
  
      char* Account::operator=(char* ls){
  
          strcpy(_name, ls);
  
          return _name;
  
      }
  
  
  }
  </code></pre>
  
  <p>and finally the main:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  #include "Account.h"
  using namespace sict;
  using namespace std;
  
  int main(){
    Account A;
    Account B("Saving", 10000.99);
    Account C("Checking", 100.99);
    double value = 0;
  cout &lt;&lt; A &lt;&lt; endl &lt;&lt; B &lt;&lt; endl &lt;&lt; C &lt;&lt; endl &lt;&lt; "--------" &lt;&lt; endl;
    A = B + C;
    A = "Joint";
  cout &lt;&lt; A &lt;&lt; endl &lt;&lt; B &lt;&lt; endl &lt;&lt; C &lt;&lt; endl &lt;&lt; "--------" &lt;&lt; endl;
  A = B += C;
  cout &lt;&lt; A &lt;&lt; endl &lt;&lt; B &lt;&lt; endl &lt;&lt; C &lt;&lt; endl &lt;&lt; "--------" &lt;&lt; endl;
  value += A;
  value += B;
  value += C;
  cout &lt;&lt; "Total balance: " &lt;&lt; value &lt;&lt; endl;
    return 0;
  }
  </code></pre>