#include<stdio.h>
int main(){
int i = 3;
int *k;
k = &i;
k++;
printf("%d ",*k);
return 0;
}
Output : Garbage value
#include<stdio.h>
int main(){
int i = 3;
int *j;
int **k;
j = &i;
k = &j;
k++;
printf("%d ",**k);
return 0;
}
Output:Runtime error
In both the programs k is a pointer variable and it access the uninitailzed memory. My Question is why it returns as runtime error in the second program