I want to pass the B int array pointer into func function and be able to change it from there and then view the changes in main function
#include
Make use of *(B) instead of *B[0].
Here, *(B+i) implies B[i] and *(B) implies B[0], that is *(B+0)=*(B)=B[0].
#include
int func(int *B){
*B = 5;
// if you want to modify ith index element in the array just do *(B+i)=
}
int main(void){
int B[10] = {};
printf("b[0] = %d\n\n", B[0]);
func(B);
printf("b[0] = %d\n\n", B[0]);
return 0;
}