K
Karl Ebener
Hi!
Sorry, to bother you with so many questions in a row, but I am
struggling to get into C++ whilst having to complete a quite complex
program...
My (current) problem:
When I define a class with constructors like
class c_Message
{
public:
c_Message();
c_Message(string cnt);
....
<snip>
....
};
I am getting the problem, that whenever I instantiate with an argument
c_Message msg("Hallo");
I can use this object.
But when I instantiate
c_Message msg();
and later want to set the content of the message using a method, I get
the following error:
error: request for member `setContent' in `msg ', which is of
non-aggregate type `c_Message ()()'
I cannot use the classes methods, but when using an argument to
instantiate, I can.
What should I do?
Tnx again very much
Karl
Sorry, to bother you with so many questions in a row, but I am
struggling to get into C++ whilst having to complete a quite complex
program...
My (current) problem:
When I define a class with constructors like
class c_Message
{
public:
c_Message();
c_Message(string cnt);
....
<snip>
....
};
I am getting the problem, that whenever I instantiate with an argument
c_Message msg("Hallo");
I can use this object.
But when I instantiate
c_Message msg();
and later want to set the content of the message using a method, I get
the following error:
error: request for member `setContent' in `msg ', which is of
non-aggregate type `c_Message ()()'
I cannot use the classes methods, but when using an argument to
instantiate, I can.
What should I do?
Tnx again very much
Karl