C++ Text Based Inventory Pt.2 : <p>I'd first like to start off by thanking everyone who helped me yesterday with another error. My teacher is currently off of work due to an accident and we don't use any reference books in the class (not provided), so please bear with me here if my post isn't formatted correctly or if my problem is quite obvious to everyone else. I'm now getting two errors in my code after adding some more lines (using this <a href="https://stackoverflow.com/questions/31093180/c-text-rpg-inventory-system">post</a> as a reference for my own project.) The two errors I get are:</p>

<pre><code>Error (active)  E0349   no operator "=" matches these operands operand types are: Item = std::string line 76    
</code></pre>

<p>and </p>

<pre><code>Error   C2679   binary '=': no operator found which takes a right-hand operand of type 'std::string' (or there is no acceptable conversion) line 76 
</code></pre>

<p>Like I stated early in this post, we were assigned this RPG project in class but my teacher got into an accident, and there is no help available (our substitute is a retired lady who is basically a career substitute with no coding experience).</p>

<p>Here is all my code: </p>

<pre><code>// clunkinv.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include "pch.h"
#include &lt;iostream&gt;
#include &lt;fstream&gt;
#include &lt;iomanip&gt;
#include &lt;vector&gt;
#include &lt;ostream&gt;
#include &lt;Windows.h&gt;
#include &lt;string&gt;
#include &lt;cstring&gt;
#include &lt;cctype&gt;
using namespace std;

struct Item {
    string name; //Item name.
    int slot; //Head, Torso, Hands
    int attack;
    int knowledge;
    int defense;
    int hp;
    int speed;
    int charisma;
};

std::ostream &amp;operator&lt;&lt;(std::ostream &amp;os, const Item&amp; item) {
    os &lt;&lt; item.name;
    return os;
}

    int main()
    {

        //Variables, Strings, etc.
        int itemcounter = 0, counter = 0;
        string search;


        //"Empty" Item
        Item Empty{ "&lt;Empty&gt;", 0, 0, 0 };

    Item Sword{
        "Paper Cutter Sword", //This item name is 'Short Sword'.
        3, //Slot
        3, //Attack
        0,
        0,
        0,
        0,
        0,
        };

        vector&lt;Item&gt; Equipment = { 6, Empty }; //Current Equipment, 6 empty slots.
        vector&lt;Item&gt; Inventory = { }; //Inventory
        string InventorySlots[] = { "Head" "Torso", "Hands" }; //Player slots where items can be equiped.

        cout &lt;&lt; "You sit your bag down and take a look inside." &lt;&lt; " You have:" &lt;&lt; endl;
        cout &lt;&lt; "Enter 'Equip' to equip an item, or 'inventory' to see full inventory" &lt;&lt; endl;

        for (int i = 0; i &lt; itemcounter; i++)
        {
            cout &lt;&lt; InventorySlots[i];
            if (Equipment[i].name == "Empty ") 
            {
                cout &lt;&lt; " " &lt;&lt; Equipment[i].name &lt;&lt; endl &lt;&lt; endl; 
            }
        }

        if (search == "inventory") {
            cout &lt;&lt; "What do you want to equip? ";
            cin &gt;&gt; search;
            for (unsigned i = 0; i &lt; Inventory.size(); i++) {
                //Search for item player want to equip, put it in right slot.
                if (search == Inventory[i].name) {
                    Equipment[Inventory[i].slot] = Inventory[i].name;
                    cout &lt;&lt; "Successfully equiped!" &lt;&lt; endl;
                }
            }
        }

        if (search == "inventory") {
            for (unsigned i = 0; i &lt; Inventory.size(); i++) {
                cout &lt;&lt; "______________________________________________________________" &lt;&lt; endl;
                cout &lt;&lt; "|  " &lt;&lt; Inventory[i].name &lt;&lt; endl;
                cout &lt;&lt; "|  Carried items " &lt;&lt; Inventory.size() &lt;&lt; " / " &lt;&lt; 20 &lt;&lt; endl;
                cout &lt;&lt; "|_____________________________________________________________" &lt;&lt; endl;
            }
        }

    }
</code></pre>
