Boa noite, a descricao do exercicio está aqui: exercicio 1 Armas.h #include <iostream>
#ifndef ARMAS_H
#define ARMAS_H
using namespace std;
class Armas
{
public:
static void setId(int);
static void setNome(string);
static void setTipo(string);
static void setDano(int);
int getId();
string getNome();
string getTipo();
int getDano();
protected:
int id;
string nome;
string tipo;
int dano;
};
#endif
Armas.cpp
#include "Armas.h"
void Armas::setId(int id)
{
id = id;
}
void Armas::setNome(string nome)
{
nome = nome;
}
void Armas::setTipo(string tipo)
{
tipo = tipo;
}
void Armas::setDano(int dano)
{
dano = dano;
}
int Armas::getId()
{
return id;
}
string Armas::getNome()
{
return nome;
}
string Armas::getTipo()
{
return tipo;
}
int Armas::getDano()
{
return dano;
}
ColecaoArmas.h
#ifndef COLECAOARMAS_H
#define COLECAOARMAS_H
#include "Armas.h"
class ColecaoArmas
{
public:
static void incluirArma(int, string, string, int);
void excluirArma(int);
void exibirArmas();
};
#endif
ColecaoArmas.cpp
#include "ColecaoArmas.h"
void incluirArma(int id, string nome, string tipo, int dano)
{
Armas::setId(id);
Armas::setNome(nome);
Armas::setTipo(tipo);
Armas::setDano(dano);
}
void excluirArma(int)
{
}
void exibirArmas()
{
}
principal.cpp
#include <iostream>
#include "Armas.h"
#include "ColecaoArmas.h"
using namespace std;
int main()
{
Armas *faca = new Armas();
faca->incluirArma(1, "faca", "melee", 3);
system("pause");
return 0;
} To no Visual Studio... Sei q devo tah fazendo merda... mas ateh aqui o Visual me diz q tem erro no metodo main, nesta linha: faca->incluirArma(1, "faca", "melee", 3); Se alguém puder me explicar, agradeço...