小编Gam*_*alz的帖子

基于C ++文本的RPG库存系统

我目前正在学习编程2类(c ++),我们受命制作基于文本的rpg。我将此帖子用作库存系统的参考,因为我认为它非常有效。但是我一直遇到E0349“没有运算符“ ==”或“ <<”与这些操作符匹配“错误。

如果有人可以帮助我,那就太好了。这是我的全套代码:

#include "pch.h"
#include <iostream>
#include <fstream>
#include <iomanip>
#include <vector>
#include <ostream>
#include <Windows.h>
#include <string>
#include <cctype>
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;
  };

int main()
{

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


    //"Empty" Item
    Item Empty{ "<Empty>", 0, 0, 0 };

    vector<Item> Equipment = { 6, …
Run Code Online (Sandbox Code Playgroud)

c++ operator-overloading

6
推荐指数
1
解决办法
344
查看次数

标签 统计

c++ ×1

operator-overloading ×1