G
Guest
Hello
I have a problem. The following program throws a "0" instead of a "25". I´m from the JAVA world, and in JAVA the output is "25"
Hope, anybody can help me
Thanks ..
class Content
public
Content()
wert = 0
Content::~Content()
int getValue()
return value
void setValue(int _value)
value= _value
private
int value
}
--
#include "Content.h
class Container
public
Container()
Container::~Container()
Content getContent()
return content
void setContent(Content _content)
content = _content
private
Content content
}
--
// Allocationproblem.cp
/
#include "stdafx.h
#include <iostream.h
#include "Container.h
int main(int argc, char* argv[])
Container container = Container()
container.getContent().setValue(25)
cout << container.getContent().getValue() << endl
return 0
I have a problem. The following program throws a "0" instead of a "25". I´m from the JAVA world, and in JAVA the output is "25"
Hope, anybody can help me
Thanks ..
class Content
public
Content()
wert = 0
Content::~Content()
int getValue()
return value
void setValue(int _value)
value= _value
private
int value
}
--
#include "Content.h
class Container
public
Container()
Container::~Container()
Content getContent()
return content
void setContent(Content _content)
content = _content
private
Content content
}
--
// Allocationproblem.cp
/
#include "stdafx.h
#include <iostream.h
#include "Container.h
int main(int argc, char* argv[])
Container container = Container()
container.getContent().setValue(25)
cout << container.getContent().getValue() << endl
return 0