c - remove newline characters from text file while writing data -


i getting newline character text file while writing content text file using code below

sprintf(str,"godownname,lorrynumber,invoicenumber,cementcompanyname,rcvdprsnname,rcvdprsndsgnation,entityqty,date\0"); write(fd,str,strlen(str)); 

the text writing 2nd row , unwanted newline writing @ 1st row. want text written 1st row. please 1 me remove newline characters or spaces text file

thanks in advance

my guess have function writes in fd before call of function.

besides, writing "\0" @ end of string litteral useless, there's one.


Comments

Popular posts from this blog

Python __call__ special method practical example -

arrays - jQuery - Retrieve values from HTML elements and return their sum -