I want to write a text and save it in .txt using <stdio.h> and <stdlib.h>. But with this way, I only could save one line, no more. 
int main()
{
   file*pf;
   char kar;
   if ((pf = fopen("try.txt","w")) == NULL)
   {
      printf("File couldn't created!\r\n");
      exit(1);
   }
   while((kar=getchar()) != '\n')
      fputc(kar, pf);
   fclose(pf);
}
 
     
     
    