Questions tagged [trailing-newline]

A trailing newline is a newline character that appears at the end of a file or a line or a string.

Overview

A trailing newline is a newline character that appears at the end of a file or a line or a string.

It is a common convention in many operating systems and programming languages to include a trailing newline at the end of text files.

Questions that may be appropriate for this tag include:

  • How to add a trailing newline to a file using a specific programming language?
  • How to remove a trailing newline from a file or string using a specific programming language?
  • What is the purpose of a trailing newline in a text file?
16 questions
-2
votes
1 answer

it works with gets but not with fgets?

#include int main(){ char a[20],b[20]; int i,c=0,m=0; fgets(a,20,stdin); fgets(b,20,stdin); while(a[c]!=0){ c++; } for(i=0;i
1
2