[Solved] How to correct segmentation fault with char * to int conversion
You are confusing pointers with arrays. A pointer just points; declaring a pointer does not reserve memory, it just creates a pointer variable pointing to some undefined place. Corrected program: char *recepcao(char *receber) { scanf(“%s”, receber); return receber; } int conversao(char *string) { int i, j; for(i=0; string[i]!=’\0′; ++i) { continue; } int var[100]; int … Read more