vendredi 26 avril 2019

How to fix Vector Position within Struct Player object so it'll work with me.position in Main?

I am teaching myself C++11 and this was one of my homework assignment, however the vector position; doesn't seem to work.

I've tried #include and std::vector, nothing seems to work.

#include <iostream>
#include <string>
using namespace std;


struct Player
{
    string name;
    int hp;
    vector position;
}; 

int main()
{

Player me;
me.name = "Metalogic";
me.hp = 100;
me.position.x = me.position.y = me.position.z = 0;

return 0;

}

I'd like for it to cout << player << hp << position

Aucun commentaire:

Enregistrer un commentaire