Re: A function returning string or pointer



In article <1163525240.860273.84030@xxxxxxxxxxxxxxxxxxxxxxxxxxx>,
santosh <santosh.k83@xxxxxxxxx> wrote:

do
{
ch = getc(fp);
}
while(ch != EOF && ch != '\n');

This may be okay for flushing input but if you want to process it, then
having the test for EOF and NL at the bottom is wasteful as the code
within the DO clause has to do the test anyway.

A reasonable compiler will optimise that if you could. Even if it
doesn't, clarity is usually much more important than that kind of
micro-optimisation.

-- RIchard
--
"Consideration shall be given to the need for as many as 32 characters
in some alphabets" - X3.4, 1963.
.



Relevant Pages

  • Re: Data order on response form
    ... The addition to the bottom of the messages has nothing to do with the sender of the email ... - it is added by his anti-virus software on receipt of the email ... plus additional data about the virus protection program, ... | "eofeofeof" so my import program can ignore everything after the 'EOF' ...
    (microsoft.public.frontpage.programming)
  • Re: recno() and "Record is out of range"
    ... recdno, if EOF encountered, then goto the top or bottom. ... on the new filter or an SQL Order By clause or Set Order To. ...
    (microsoft.public.fox.vfp.forms)
  • Re: Toolbar
    ... There is no FIRSTREC() and LASTREC() function, of course you can make them ... IF EOF() ... > or bottom of the table rather than wait for a bofor eof, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: write error
    ... Bill Cunningham said: ... The text is in between the bottom of the first page and top of ... Do not confuse the concept of an EOF ... Richard Heathfield ...
    (comp.lang.c)
  • RE: Query OVERFLOW Error
    ... They often start at the bottom and work ... moving the last line up to the top of the WHERE clause. ... query that works then creating a second query based on it to get the rest of ...
    (microsoft.public.access.queries)