I have a multiple arguments of type
string m_strVar1 = "var1";
string m_strVar2 = "var2";
string m_strVar3 = "var3";
// i have like above like 10 variables.
for(int i = 1; i < 10 ; i++) {
string strArg = "m_strArg";
std::stringstream lStream;
lStream << argCnt;
strArg.append(lStream.str());
cout << "first argument is " << strArg.c_str() << endl;
// call the function
func1(strArg.c_str());
}
///////////////
void func1(string& arg1) {
// here i am expecting to access m_strVar1/2 value, depending on argument but value is not shown.
}
I think i am doing some thing wrong. can u please correct me. How can we achieve for calling the function with out calling 10 times with differnt values.