Let's have a look to this code. I was thinking a c++ function only returns an int value in eax. So where does it store the vector result ? Heap ? Stack ?
Thanks
#include <iostream>
#include <vector>
using namespace std;
vector<int> fonction(int a)
{
        vector<int> vec;
        for (int i=0;i<a;i++)
        {
                vec.push_back(1);
        }
        return vec;
}
int main(int argc, char *argv[])
{
        cout << "test" << endl;
        auto res = fonction(10);
        cout << res.size() << endl;
        return 0;
}
 
     
     
    