Re: equivalent of chomp in perl
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Thu, 02 Nov 2006 22:05:27 -0500
lnatz wrote:
Is there an equivalent to the perl command chomp in C? And if
there is no exact equivalent command, how would I go about
removing the "\n" at the end of a stdin?
int flushln(FILE *f) {
int ch;
while (('\n' != (ch = getc(f))) && (EOF != ch)) continue;
return ch;
}
--
Chuck F (cbfalconer at maineline dot net)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net>
.
- Follow-Ups:
- Re: equivalent of chomp in perl
- From: Keith Thompson
- Re: equivalent of chomp in perl
- References:
- equivalent of chomp in perl
- From: lnatz
- equivalent of chomp in perl
- Prev by Date: Re: comparing ptrs/mmap
- Next by Date: Re: equivalent of chomp in perl
- Previous by thread: equivalent of chomp in perl
- Next by thread: Re: equivalent of chomp in perl
- Index(es):
Relevant Pages
|