79443807

Date: 2025-02-16 19:39:32
Score: 1
Natty:
Report link

I come across this old topic. My way to ignore '\n' is:

#include <string.h>
#include <stdio.h>
#define MAX_LENGTH 512

char *line, *tok;
FILE *file;

  fgets(line, MAX_LENGTH, file);
  tok = strchr(line, '\n');
  if (tok) *tok = '\0';
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Carlo Nervi