Is it possible/advised to store a vector in a struct? C++ -


i have thought of struct fixed sized object , while there doesn't seem glaring compiler errors, wondering if doing in practice. changing struct class more advisable or struct well?

the code, because people fussy:

struct sprite {     float x;     float y;     std::vector<sprite> sprite; } 

the essence of doing having children of class same type parent. when parent dies, children too.

an std::vector has specific known size, , class or struct contains has specific known size. std::vector allocates memory on heap act variable sized array , stores pointer said memory. difference between struct , class struct defaultly public, , class defaultly private.


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -