new object declaration

B

balal.cse

hi
i came across a program where the object is declared as
Qpixmap instance();
here Qpixmap is a class and i am sure that there is no constructor in
the program .i cant understand ,please help.

Thanks in advance
 
M

martyw

hi
i came across a program where the object is declared as
Qpixmap instance();
here Qpixmap is a class and i am sure that there is no constructor in
the program .i cant understand ,please help.

Thanks in advance
this progam is probably having a line '#include <qpixmap.h>', where the
qpixmap class is defined, a part of qt - see
http://doc.trolltech.com/3.3/qpixmap.html
 
P

Pete Becker

i came across a program where the object is declared as
Qpixmap instance();

This line declares a function named instance that takes no arguments
and returns an object of type Qpixmap.
 
J

Juha Nieminen

hi
i came across a program where the object is declared as
Qpixmap instance();
here Qpixmap is a class and i am sure that there is no constructor in
the program .i cant understand ,please help.

Besides that line declaring a function, like others have said,
even if it created an object, so what if it the class doesn't have
an explicit constructor? It will have an implicit one.
 

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

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,201
Messages
2,571,048
Members
47,647
Latest member
NelleMacy9

Latest Threads

Top