I tried to get how many bytes are allocated for an array using standalone function but I failed. My code is as follows:
#include <stdio.h>
void testing(char *source);
int main(){
char a[12] = "Hello World!";
//printf("%d",sizeof(a)); Prints 12. I want to get this value
testing(a); // Prints 4. I need to get 12 by using functions
return 0;
}
void testing(char *source){
printf("%d",sizeof(source));
}
I want to get result as 12 but output tells me that it is 4.