#include <stdio.h>
void out(int *a, int arr[], char *str, int sz){
printf("%d\n",*a);
//in C, when you pass an array to a function, it decays into a pointer, and you lose the information
//about its size. In this case, you won't be able to calculate the size of the array inside the
//function accurately without passing it explicitly
//size_t sz = sizeof(arr)/sizeof(arr[0]);
for(int i=0;i<sz;i++){
printf("%d",arr[i]);
}
printf("\n%s",str);
}
int main() {
int a = 10;
int arr[10] = {1,2,3,4,5,6};
char *str = "adarsh";
size_t sz = sizeof(arr)/sizeof(arr[0]);
out(&a,arr,str,sz);
return 0;
}
To embed this program on your website, copy the following code and paste it into your website's HTML: