Easy Question


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]

Posted by Vinnie on July 27, 1999 at 17:25:09:

In the OutputDir function that was give to us ...

void OutputDir ( char *dir, char level )
{
char s[2048];
int state;

DirectoryReader A (dir);
while ((state = A.GetName (s, sizeof (s))))
{
if ((strcmp (s, ".") != 0) && (strcmp (s, "..") != 0))
{
for ( int i=0; i<=level; i++ )
cout << "---";
cout << s << "\n";
if (state == 2)
OutputDir (s, level+1);
}
}
}

How does the while statement work?
while ((state = A.GetName (s, sizeof (s))))

Wouldn't that *always* be true?

I know I'm missing something simple ...


Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2604 Discussion WWWBoard ] [ FAQ ]