I have some code, and I get an error while running it:
1 2 3 4 5 6 7 8 9 10 11 12 13
//GameVectorz.h
#ifndef GAME_VECTORZ_H
#define GAME_VECTORZ_H
#include <vector>
#include "Startup.h"
class Vectorx{
public:
void Vectorx::add_vectorz(vector<StartProfile> a, int player,
vector<StartProfile> b);
vector<StartProfile::question> questions;
vector<StartProfile> Players;
};
#endif
1 2 3 4 5 6
//GameVectorz.cpp
#include "GameVectorz.h"
void Vectorx::add_vectorz(vector<StartProfile> a, int player, vector<StartProfile> b){
a.push_back(b);
}
When I run, I get this error:
Line Location GameVectorz.cpp:13: error: no matching function for call to '__gnu_debug_def::vector<StartProfile, std::allocator<StartProfile> >::push_back(__gnu_debug_def::vector<StartProfile, std::allocator<StartProfile> >&)'
By the way that is not "Adding" the vectors that is just storing a vector inside of another vector(that holds vectors.)
If you want to add maybe overload the operator+