Article View: be.comp.programming
Article #2389Trying to overload the << operator using C++
From: Jim
Date: Tue, 08 Jun 2004 11:52
Date: Tue, 08 Jun 2004 11:52
34 lines
1274 bytes
1274 bytes
I am trying to overload the << operator to a bag that is a class.
container is a bag.
class bag;
bags_to_use = 12;
bag container[bags_to_use]; // A declared bag of arrays.
So you have a structure that is an array initialized of 12 containers.
I would think that the correct implementation of overloading the
operator would be something of the following:
ostream& operator <<(ostream& outs, const bag& container[bags_to_use])
{
stuff I will write later.
}
but I think that I may be wrong? Is my syntax wrong?
thanks,
Jim
Technical Details
Message-ID:
<2in1o6Fpl2ivU1@uni-berlin.de>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcea4,a23b69b2c15cdca2,start X-Google-Attributes: gidfcea4,public Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Jim <jtracy@bridgew.edu> Newsgroups: be.comp.programming Subject: Trying to overload the << operator using C++ Date: Tue, 08 Jun 2004 07:52:11 -0400 Lines: 34 Message-ID: <2in1o6Fpl2ivU1@uni-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de YLuV3TM7miQKi9nWP9t5kQT+jaJ14T1GRt8ss38/cgXg3KOiZc User-Agent: Mozilla Thunderbird 0.6 (X11/20040502) X-Accept-Language: en-us, en