[ Post New Message | Post Reply to this One | Send Private Email to Mike Mannakee | Help ]

0 vs. "0"

from Mike Mannakee (B3FEETBACK@AOL.com)
In the implementation of operator >>, after the variables are read in, you have:
    if (Expires == "0")
which of course checks if this worker is a dated or undated object. However, in the undated object code (which would output the 0), the Write(ostream& os) function has:
    os<<0<<endl;
I was expecting that either
1. the write function would output "0" or
2. the >> operator would check for 0 instead of "0", to maintain the same syntax.

What don't I know here? I'm missing something.

(posted 9321 days ago)

[ Previous | Next ]