2 Replies - 456 Views - Last Post: 13 July 2010 - 11:44 AM Rate Topic: -----

#1 stoplookandlisten  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 11-January 10

newline problem after the end of an array of array

Posted 13 July 2010 - 11:02 AM

i have a problem concerning newline after the reading the end of an array of array.

i have a text file "input.txt" with the following text:

Pedro
Juan
Alberto

when i sort this

it should print out like this

Alberto
Juan
Pedro


but in my standard output it prints out

Alberto
JuanPedro

How to put newline in this situation

i am using fgets in reading and fputs in writing

thanks

This post has been edited by stoplookandlisten: 13 July 2010 - 11:03 AM


Is This A Good Question/Topic? 0
  • +

Replies To: newline problem after the end of an array of array

#2 JITHU  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 62
  • View blog
  • Posts: 201
  • Joined: 02-July 07

Re: newline problem after the end of an array of array

Posted 13 July 2010 - 11:05 AM

Post your code between [code] tags.

This post has been edited by JITHU: 13 July 2010 - 11:06 AM

Was This Post Helpful? 0
  • +
  • -

#3 sarmanu  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 966
  • View blog
  • Posts: 2,362
  • Joined: 04-December 09

Re: newline problem after the end of an array of array

Posted 13 July 2010 - 11:44 AM

We can't help you unless you post the code. Don't forget to use code tags.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1