Hello,
It's been ages since i've coded in c and i'm assuming im having a problem with the syntax. I am sure this is stupid and very in my face but i cant seem to work out my errors at compile time.
disk.c: In function `update_rw_requests':
disk.c:531: error: `rw' undeclared (first use in this function)
disk.c:536: error: `algorithm' undeclared (first use in this function)
disk.c: At top level:
Thats the compilers complaints (i have a few more of those from other functions i've written aswell).
528 void update_rw_requests(ReadOrWrite rw, String algorithm)
529 {
530 stats_num_requests++;
531 if (rw == READ) {
532 stats_num_reads++;
533 } else if (rw == WRITE) {
534 stats_num_writes++;
535 } else {
536 fprintf(stderr, "%s: bad rw\n", algorithm);
537 }
538 }
This one is a little more straightforward than the others with the same type of error, so i figured it should be easy to spot here.
Just incase this helps make it clear
typedef enum {
READ, WRITE
} ReadOrWrite;
Thanks for any and all help guys :)
- xyster