I write the following code to write a text. strcmp is supposed to terminate the file writing when the user type #. Still doesn't do it and i cannot exit the program
#include <stdio.h>
#include <string.h>
int main()
{
FILE *fp;
char c[100];
fp = fopen ("/home/smksx/Desktop/uniprograms/domes/arxeio2","w");
printf ("\n\nWrite your text\n\n");
printf ("\n\nTerminate with #\n\n");
while (strcmp(c,"#")!=0)
{
scanf ("%s",&c);
if (strcmp(c,"#")!=0)
{
fprintf (fp,"%s",c);
}
}
fclose(fp);
return 0;
}