there have been a lot of resources on this but I could not really understand the concept of this.
Here is my attempt using pointers:
struct PEOPLE{
int id;
string name;
float cash;
};
int main(){
PEOPLE data[5];
getdata(data);
for(int i = 0; i < 5; i++){
cout << data[i].id << " " << data[i].name << " " << data[i].cash;
}
return 0;
}
void getdata(PEOPLE &*refdata[5]){
refdata[0].id = 11;
refdata[0].name = "John Smith";
refdata[0].cash = 200.30;
//and so on for index 1,2,3,4
}
Is this approach correct, I doubt it will work.