On Thu, Dec 2, 2010 at 9:02 PM, ben <bfranchuk at jetnet.ab.ca> wrote:
On 12/2/2010 7:51 PM, Brent Hilpert wrote:
main()
{
Read();
}
Read()
{
blah;
blah;
}
Well I am stumped, other case sensitvity for Read
and the OS read routine, when linked.
I'm stumped as well. I'm not helped by the fact that I can't remember
the specifics of the C standard library. Is the read function exactly
called Read? If that's the case, maybe this is a forward declaration
problem where the compiler picks the standard library function over
the one in the code since it hasn't found the symbol yet?
When I was working on my CS degree, about a half dozen of us were
stumped by this one:
int somefunction()
{
while(somevalue == true);
{
printf("test\n");
}
}
Like the one from brent, it's a little more obvious without all the
extra code around the problem. The issue is that no matter what we
put in the criteria, we'd get either exactly one "test", or the while
loop would get stuck forever printing nothing. I finally did spot it
after about a hour of staring at it. Maybe we would all have found it
faster if it hadn't been 3 in the morning with us all pulling
all-nighters to get the assignment done.
brian