Code is not compiling successfully

source.cpp: In function ‘int complete(int*, int*)’:
source.cpp:8:16: warning: ‘sizeof’ on array function parameter ‘p’ will return size of ‘int*’ [-Wsizeof-array-argument]
8 | int n=sizeof§/sizeof(int);
| ^
source.cpp:4:18: note: declared here
4 | int complete(int p[],int c[]){
| ~~^

In C++ , array parameters are treated as pointers
So the expression sizeof(arr)/sizeof(int) becomes sizeof(int *)/sizeof(int) which is constant (and depend on machine size of int) irrespective of the size of the array.
so it will not give you size of array
Therefore, sizeof should not be used to get number of elements in such cases. A separate parameter for array size (or length) should be passed to fun()