Structures help

Hi everybody. Hope you're all well.

Mi question is:

How can i do for pass by reference an structure like I have in main()?

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
struct loans{

       string client;
       int loan_num;
       float debt;

};

void delete_loan(structure loan1 by reference){

}

main(){

loans loan1 = new loans[100];

delete_loan(structure loan 1 by reference);

}


Thanks in advance.
Please any help.
You simply specify that delete_loan takes a reference like this:

1
2
3
4
5
6
7
8
9
10

void delete_loan( loans& MyLoan );

//Then in main, call it like this:

loans ABigLoan;


delete_loan( ABigLoan );
Topic archived. No new replies allowed.