Witam czy funkcja może zwracać 2 wartości?Np mam rekurencyjnie wypisać tablice od tyłu
I coutem zrobiłem to normalnie tak:
int tab(int size, int tabs[])
{
cout << tabs[size - 1] << endl;
if (size > 1)
{
return tab(size - 1, tabs);
}
return 1;
}
I działa,ale z czystej ciekawości czy moze byc tak:
int tab(int size, int tabs[])
{
return tabs[size - 1];
cout << endl;
if (size > 1)
{
return tab(size - 1, tabs);
}
return 1;
}