#include<stdio.h>
void func(int x[]);
main()
{
int a[]={1,2,3,4};
printf("size of %d \n",sizeof(a)); // Some value I'm getting
func(a);
}
void func(int a[])
{
printf("size of %d",sizeof(a)); // Value is changing
}
Both times, the value of 'a' is not printing the same. To get the same value by maintaining this code, what more code need to be added or any changes required?
I don't want to change the signature of any function. Without changing the signature, what extra code is needed to be added inside func(int a[])
?.