CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM

nl or endl or \n

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 23, 2011, 09:45
Default nl or endl or \n
  #1
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Hi FOAMers
can any one tell me what is the difference between nl and endl and \n
best regards
ata is offline   Reply With Quote

Old   January 23, 2011, 15:57
Default
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,758
Rep Power: 21
hjasak will become famous soon enough
endl flushes the buffer
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   January 24, 2011, 02:30
Default nl or endl or \n
  #3
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Dear Prof. Jasak
Thank you very much for quick reply.
Would you please tell me when we must use endl when nl and when \n?
Thank you very very much
ata is offline   Reply With Quote

Old   January 24, 2011, 05:45
Default
  #4
Assistant Moderator
 
Bernhard Gschaider
Join Date: Mar 2009
Posts: 3,915
Rep Power: 40
gschaider will become famous soon enoughgschaider will become famous soon enough
Quote:
Originally Posted by ata View Post
Dear Prof. Jasak
Thank you very much for quick reply.
Would you please tell me when we must use endl when nl and when \n?
Thank you very very much
Google for "c++ flush buffer". If you're still in doubt use endl
gschaider is offline   Reply With Quote

Old   January 24, 2011, 05:54
Default nl or endl or \n
  #5
ata
Senior Member
 
ata's Avatar
 
ata kamyabi
Join Date: Aug 2009
Location: Kerman
Posts: 322
Rep Power: 8
ata is on a distinguished road
Thanks a lot
ata is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 17:22.