RS> Here's something I'm not clear about...
RS> #include
RS> int main( void )
RS> {
RS> ifstream source ("infile");
RS> if(!source)
RS> blablabla...
RS> When is the file opened in that snip?
In the constructor for the object `source'.
RS> Is the reason this works the same as why the next line works?
TM>>>>> ofstream("file1.fil") << name;
Pretty much. The syntax there creates an unnamed temporary ofstream object
for use in the rest of the expression.
¯ JdeBP ®
--- FleetStreet 1.19 NR
---------------
* Origin: JdeBP's point, using Squish (2:440/4.3)
|