trying to understand arrays and pointers

This commit is contained in:
kevinnls committed 2021-09-20 01:20:58 +05:30
1 parent 9678b35422
commit 8a4412e155
1 file changed
+13 -4
+13 -4
View File
@@ -1,8 +1,17 @@
#include<stdio.h> #include<stdio.h>
int* sort();
int main(){ int main(){
if(printf("hello, world")) int arr[] = {1,2,4,593,29,19,0};
return 0; sort(arr);
else }
return 1;
int* sort(int* arr){
printf("`arr` is: %d\n", arr);
printf("`*arr` is %d\n", *arr);
printf("`&arr` is %d\n", &arr);
printf("`arr[0]` is %d\n", arr[0]);
// printf("`*arr[0]` is %d\n", *arr[0]); /// not possible
printf("`&arr[0]` is %d\n", &arr[0]);
} }