umm in that code i don't know why it produces a runtime error....i know that the problemCode:#include <stdio.h> #include <string.h> #include <stdbool.h> int main(void) { char ar[20],*p; int a; gets(ar); if(a=atoi(ar)) printf("%d",a); else { while(true) { p=strchr(ar,'s'); if(*p=='\0') break; } printf("why?"); } return 0; }
is somewhere in the memory but could someone help me so that it would not produce
a run-time error...thanks!!