stripping newline from input
From: John Smith (soneone_at_microsoft.com)
Date: 08/31/04
- Next message: Minti: "Re: Small C "Puzzle""
- Previous message: Minti: "Re: Small C "Puzzle""
- Next in thread: Joona I Palaste: "Re: stripping newline from input"
- Reply: Joona I Palaste: "Re: stripping newline from input"
- Reply: Ravi Uday: "Re: stripping newline from input"
- Reply: CBFalconer: "Re: stripping newline from input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 12:48:23 +0100
Hi all
Why doesn't this seem to work?
void stripnl(char *sz)
{
char *nl;
nl = strchr(sz, '\n');
if (nl)
{
*nl = '\0';
}
}
The string fed in still has the newline after calling this function.
Thanks
John
- Next message: Minti: "Re: Small C "Puzzle""
- Previous message: Minti: "Re: Small C "Puzzle""
- Next in thread: Joona I Palaste: "Re: stripping newline from input"
- Reply: Joona I Palaste: "Re: stripping newline from input"
- Reply: Ravi Uday: "Re: stripping newline from input"
- Reply: CBFalconer: "Re: stripping newline from input"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]