Computer Science
"Passing Data" Please respond to the following:

Question Description

Give an example of how you could send data to a subroutine. Do you expect the data to change or remain the same?

Student has agreed that all tutoring, explanations, and answers provided by the tutor will be used to help in the learning process and in accordance with Studypool's honor code & terms of service.

Final Answer

undefined

void a1(int b); -- the same (by value)

void a2(int& b); -- can change (by reference)

void a3(int* b); -- b remain the same, *b can change (by address)

void a4(const int* b), -- b and *b remain the same.(const address)

undefined

Borys_S (8123)
UC Berkeley

Anonymous
Very useful material for studying!

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4