title: How do I write a newline character in a character variable in Fortran?
body: <p>I want to store newline character in my character buffer variable <code>buff</code>. So far my code goes like this:</p>
  
  <pre><code>       program TYPE_CHECK
  
  c newline storage in buffer 
         character(100), dimension(10)  :: buff
         integer, dimension(10) :: x
         integer :: i
  
         do i=1,10
         x(i) = i
         enddo
  
         do j=1,10
         write(buff(j), 1) x(j), x(j)
   1     format(' This is line ', I3, /,
        *       ' This is newline ', I3)
         enddo
  
         do j=1,10
         write(*, "(A100)") buff(j)
         enddo
  
         end program TYPE_CHECK
  </code></pre>
  
  <p>This gives the following error:</p>
  
  <pre><code>At line 13 of file myfoo6.F
  Fortran runtime error: End of file
  </code></pre>