When the arguments of dyn_mat are constants, the code runs through without any error and s1 and s2 do store the input values.
#include<stdio.h>
int main(int argc, char const *argv[])
{
char *s1, *s2;
int n1=7, n2=8;
printf("Enter, %d \n", n1);
scanf("%s", s1);
scanf("%s", s2);
int dyn_mat[155][347];
return 0;
}
but with arguments as variables, say n1 and n2, scanf reading s1 gives segmentation fault.
dyn_matare constants, the code runs through without any error ands1ands2do store the input values. But with arguments as variables, say n1 and n2, scanf reading s1 gives segmentation fault." The code does run through with the same severe error in both cases, you just happen to not see its effects.