Confused about the topic how is value returned form function and reflect

As sir told the values are temporarily created inside a function if they are not passed by value then how in this code

code-- https://github.com/coding-blocks-archives/cplusplus-datastructures-algorithms-coding-blocks/blob/master/Arrays/bubble_sort.cpp

the parameters are passed inside void function changed then those parametes are reflceted in main function alsohow is this possible they shoud have delted as they are just local copy in function main function should not reflcet those value

@anubhavb11 hey yes this happen in case of arrays as when you call the function with array name as argument it is basically adress of first elemnt of array which is pass and function take that adress and make changes in that array.see this eg:

void myFunc(int ar[]) {
    // ar *looks like* an array?
}

int main() {
    int array[3] = {1,2,3};
    myFunc(array);
}

the compiler will translate it to this:

void myFunc(int *ar) {
    // nope, it's actually a pointer...
}

int main() {
    int array[3] = {1,2,3};
    myFunc(&array[0]); // ... to the first element
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.