I want to make a simple function that takes an int as input, makes a vector filled with string elements, then returns a string corresponding to the index of the element.
Everything seems to be fine with the code, no red squiggly lines or anything, but when I compile nothing happens at all.
I've used the push_back()
method to fill the vector, so that isn't the problem.
#include <iostream>
#include <vector>
#include <string>
races(int a) {
std::vector<std::string> race = { "Human", "Cyborg", "Android", "Aster","Ool-Rog","Criataz" };
return race[a];
};
I've run it on a browser coding site and nothing happens, and when I code it in Visual Studio I get an error:
"cannot find class to resolve delegate string"