passing a reference to xtor
From: JE (loomis53_at_cox.net)
Date: 09/30/04
- Next message: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Previous message: Francis Glassborow: "Re: string upper, string lower, string subthisforthat"
- Next in thread: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Reply: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Reply: Sumit Rajan: "Re: passing a reference to xtor"
- Reply: Francis Glassborow: "Re: passing a reference to xtor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 30 Sep 2004 09:02:48 -0700
in the code below, I get the error:
In constructor `s::s(std::ifstream&)':
`good' undeclared (first use this function)
I have a feeling this is because I'm passing a reference to a
constructor, but don't understand why. Is it possible to this or
something similar to get the same effect (passing an opened file stream
to a class's constructor)?
#include <iostream>
#include <stdlib.h>
using namespace std;
class s {
public:
s(ifstream& ifs);
};
s::s(ifstream& ifs) {
ifs.good();
}
- Next message: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Previous message: Francis Glassborow: "Re: string upper, string lower, string subthisforthat"
- Next in thread: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Reply: Karl Heinz Buchegger: "Re: passing a reference to xtor"
- Reply: Sumit Rajan: "Re: passing a reference to xtor"
- Reply: Francis Glassborow: "Re: passing a reference to xtor"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|