#include<stdio.h>
void fun1(int **iptr){
printf("%d ", **iptr); //shows value
}
void fun2(char **sptr){
//printf("%s", **sptr); shows segmentation fault
printf("%s", *sptr); //shows string
}
int main(){
char *str = "Hi";
int *x, a = 10;
x = &a;
fun1(&x);
fun2(&str);
return 0;
}
Кто-нибудь может вкратце объяснить, что происходит?
может быть глупо, но я все равно спросил это ...