The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
.
google unix.com



High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to replace any char with newline char. mightysam Shell Programming and Scripting 5 09-18-2008 08:15 PM
char c = 882 useless79 High Level Programming 1 07-30-2007 05:16 AM
char *p and char p[]. arunviswanath High Level Programming 4 07-20-2006 02:11 AM
Regarding char Pointer sweta High Level Programming 2 06-04-2006 12:09 AM
Convert Char to Dec using AWK jasmine05 Shell Programming and Scripting 4 06-09-2005 03:50 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 05-05-2005
C|[anti-trust] C|[anti-trust] is offline
Registered User
  
 

Join Date: Apr 2005
Location: Australia
Posts: 30
\n char in C

how can i change line in the file while using
write(desc,&c,sizeof(char));

?
  #2 (permalink)  
Old 05-05-2005
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,715
You have to set
Code:
c='\n';
I would consider using a higher level call like fprintf() which is easier to use, especially since you seem to be writing single characters to the output stream.
Sponsored Links
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 08:51 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0