C++的结构体struct和自定义函数的调用

怎样在main函数中调用Initlist(),并传入函数执行后的值?怎样输出Listsize(),Listlength()和Listhead()的返回值?

#include <stdio.h>
#include

using namespace std;
#define Size 8 //顺序表的容量大小

struct table {
int size; //顺序表的容量大小(形参)
int length;//顺序表的有效长度,及数组中的元素个数
int* head;//动态数组
};

void Initlist()
{
table t;
t.length = 0;
t.size=Size;
t.head = new int[t.size];

int i;
int n;
cout<<"输入"<<n<<"的值";
cin>>n;
for (i = 0; i < n; i++)
{
cout << endl<<"输入第" << i + 1 << "个数据:";
cin >> t.head[i];
t.length++;
}
};

int Listsize(table t) //求顺序表的容量大小
{
return t.size;
}

int Listlength(table t)//求顺序表中数组的元素个数
{
return t.length;
}

int Listhead(table t)//求顺序表中数组的各元素
{
int i;
int n=0;
for (i = 0; i < n; i++)
return t.head[i];
}

int main()
{
Listsize();
Listlength();
Listhead();
return 0;
}


int main()
{
    table t;
    Initlist();
    Listhead(t);
    int s=Listlength(t);
    return 0;
    
}