c++ convert from new to instance -



c++ convert from new to instance -

there problem confuses me

i created new variable

foo *a=new foo();

then declared instance variable

foo b;

now want convert new variable instance variable, did

b.setvalue0(a->getvalue0()); b.setvalue1(a->getvalue1()); b.setvalue2(a->getvalue2());

is there easier faster way this?

you can utilize re-create constructor:

foo b(*a);

assuming of course of study copying object permitted.

c++

Comments

Popular posts from this blog

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -