I'm doing a project where I use many vector-type vectors. But working with array vectors is easier, so I did the following function:
// add.cpp
vector <string> sAdd (string In[])
{
vector <string> Out;
Out.resize (sizeof(In));
for (int i = 0; i < sizeof(In); i++)
Out[i] = In[i];
return Out;
}
// add.h
vector <string> sAdd (string In[]);
// main.cpp
#include "add.h"
int main (void)
{
vector<string> op;
op = sAdd (string temp[3] = {
"Opcao1",
"Opcao2",
"Opcao3"
});
But the following error occurs in main.cpp: "Some argument was expected in sAdd." What did I do wrong?
Note: I am a beginner, so if you have an easier method, please tell me.