digitalmars.D - testing for eof
- Rev (9/9) Feb 09 2005 Is there a better way to test for EOF in a string (char[])?
- =?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= (8/16) Feb 09 2005 int i = getchar();
Is there a better way to test for EOF in a string (char[])?
char c = getchar();
token = toString(c)
if(cast(int)token[0] != 255) // this works (seeking better)
{
..
}
Thanks,
Rev
Feb 09 2005
Rev wrote:
Is there a better way to test for EOF in a string (char[])?
char c = getchar();
token = toString(c)
if(cast(int)token[0] != 255) // this works (seeking better)
{
..
}
int i = getchar();
if (i != EOF)
{
char c = i;
...
}
--anders
Feb 09 2005








=?ISO-8859-1?Q?Anders_F_Bj=F6rklund?= <afb algonet.se>