[Csci551-talk] RE: Is the sample code meant to work?

Xi Wang xiw at usc.edu
Sat Apr 16 00:19:24 PDT 2005


Seems an earlier version of parser.cpp is released instead of the final 
version. You can simply change the following function at the beginning 
of the file. (Note while loop condition is changed.)

-Xi

int CParser::getgoodlinene(char *buf)
{
     do {
         if (fgets(buf, BUFFSIZE, fp) == NULL) {
             return 1;
         }
     } while (buf[0] == '#' || buf[0] == 10 || buf[0] == 13 || buf[0] == 0);
     return 0;
}



S. Rubin wrote:

> But for project A the FIRST valid line WAS the number of clients.  It 
> skips over
> 
> comment lines and blank lines by design.
> 
> '#'  signifies comment line, buf[0] == 10  (carriage return char), 
> buf[0] == 13 (new line char)
> 
> I did not test the code myself as mine is written in C, but we all have 
> seen the sample
> 
> outputs from this code posted on the TA's web site.
> 
> Sophia
> 
>  >I'm using manager.conf from project A, and I didn't make any change to 
> the sample code.
>  >So, if the sample code is meant to work, it should work without any 
> change with valid >manager.conf file as far as project A is concerned.  
> Making parser work correctly is not a big >deal but if the sample code 
> has some hard bug in it, then we might spend more time on fixing >the bug.
> 


More information about the Csci551-talk mailing list