• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

newb c++ question

jinduy

Diamond Member
Object b;
b = Object();
//valid




Object b;
b = new Object();
//why is this invalid? i figure it would work in java
 
Because in Java, Object b; means b is a reference but in C++, it is an actual object

do this instead:

Object* b;
b = new Object();

don't forget to delete b; after you are done though.
 
Back
Top