K
kungfuelmosan
Hey guys, Im just getting into c++ at the moment so please bare with
me
Basically i need to declare a vector<string> stringArray(50)
inside a class, however by doing so i am getting the following error:
error: expected identifier before numeric constant
error: expected ';' or '...' before numeric constant
But i can declare vector<string> testArray(50); inside my main
function or a method function etc fine? it seems like i cant specify
the (50) to make it an array
My code is something like this:
#include <vector>
#include <string>
using namespace std;
class testClass {
vector<string> testArray(50);
}
Cheers!
Dan
me
Basically i need to declare a vector<string> stringArray(50)
inside a class, however by doing so i am getting the following error:
error: expected identifier before numeric constant
error: expected ';' or '...' before numeric constant
But i can declare vector<string> testArray(50); inside my main
function or a method function etc fine? it seems like i cant specify
the (50) to make it an array
My code is something like this:
#include <vector>
#include <string>
using namespace std;
class testClass {
vector<string> testArray(50);
}
Cheers!
Dan