int multif(std::vector<int> &catcher)
{
printf("\nThe array numbers are: ");
for (int i = 0; i < catcher.size(); i++)
{
catcher[i]*=2;
//printf("%d\t", catcher[i]);
return catcher[i];
}
}
Can someone help me to understand how to pass above catcher[i] to main func() in the form of entire array? Thanks in advance...
int main()
{
std::vector <int> varray;
while(true)
{
int input;
if (std::cin >> input)
{
varray.push_back(input);
}
else {
break;
}
}
multif(varray);
std::cout << multif << std::endl;