when reading a string of characters with fgets, this also saves the line break (\ n), how can I delete that line break using fgets anyway to read? It does not help me to use fscanf or another format to read Thanks.
when reading a string of characters with fgets, this also saves the line break (\ n), how can I delete that line break using fgets anyway to read? It does not help me to use fscanf or another format to read Thanks.
When you read the character string with fgets
, use strtok(cadena, "\n")
to eliminate the line break. You can also delete the character directly by accessing the string as an array of characters.