col
asked on
terminate input
How do I alter the getline function to terminate input on any one of few possibilities.
e.g.
~~~~.getline(line,LINEMAX, ('\n'||'.' ||'\t'||"a '/' followed by a space etc etc))
the above simply doesn't work.
Any help?
e.g.
~~~~.getline(line,LINEMAX,
the above simply doesn't work.
Any help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I was looking for thanks!!
while (i <count)
{
in.get(&ch);
if (dems,ch)
{
buf[i] = '\0';
return 1;
}
++i;
buf[i] = ch;
}
also you realy don't need ch. I would use the input buffer dirrectly and use a character pointer rather than index buf with [] to speed things up.