Hi, I have a problem with the segmentation fault.
This method adds letters to a string(name), but I dont know if i'm doing the wright way, I suposse itīs wrong, because the output is not the same of the line of the file and in the end of the output it appears : segmentation fault.
I want another way to add the letters to the string.
Code:int ch; int add = 0; char *name; FILE *file = fopen(".tabpasswd", "r"); while((ch=fgetc(file)) != EOF) { if(ch != ':') { name[add] = ch; add++; } printf("%s", name);
Thanks