To demonstrate, here is an example code recreating the instance of passing a dynamically allocated array to a function.
#include <stdio.h>
#include <stdlib.h>
void fx1(int* arr) {/* code here */ }
int main() {
int *arr = (int *) malloc(sizeof(int) * 10);
fx1(arr);
free(arr);
return 0;
}
In the example, I first create a dynamically allocated array, arr. Then, I pass it to a function called fx1. The title is exactly my question. Is passing a dynamically allocated array to a function in C an instance of pass-by-value or pass-by-reference? I would also like a reference/s (book, documentation, etc) if you have an answer for this.