c++ code

R

ramtin

hello;
is anybody knows waht does " void Print (ostream &) const; " do ? and
it doesn't work in visual c++ ,plz help me . . .
thanks
 
S

Saeed Amrollahi

hello;
is anybody knows waht does " void Print (ostream &) const; " do ? and
it doesn't work in visual c++ ,plz help me . . .
thanks

Hi

It depends to your code. Is it a member function of
a class and it tries to change the state of object?
Do you add
using std::eek:stream
or
using namespace std;
beforehand such declaration? ...
BTW, I guess it's a declaration of a _constant_ member function
of a class which may be prints the object into output stream.

Regards,
-- Saeed Amrollahi
 
S

SG

is anybody knows waht does

void Print (ostream &) const;

do ?

It looks like a declaration of a non-static member function with the
name Print that does not change the object it is invoked on and takes
an ostream object by reference.

My guess is that the function will send a textual representation of
the object's current state to this ostream.
it doesn't work in visual c++ , plz help me . . .

You havn't provided enough information for us to help you. Google for
"how to ask questions the smart way".

Cheers!
SG
 
P

Puppet_Sock

hello;
is anybody knows waht does " void Print (ostream &) const; " do ? and
it doesn't work in visual c++ ,plz help me . . .
thanks

The comp.lang.c++ FAQ is available at

http://www.parashift.com/c++-faq-lite/

Please read down to the "how to ask a question" question.
In order to answer your question we need more context.

The context, by the way, would almost certainly answer
your question for you.
Socks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top