Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Question for the C++ gurus
Message
From
12/05/2000 00:24:35
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00368531
Message ID:
00368941
Views:
20
>Charlie,
>
>Garbage collection ain't perfect either.
>
>C++ also supports block scoped items:
>
>
void MyFunc( void )
>{
>int i; // on the stack
>SomeClass o; // o the object reference o will be on the stack
>
>o = new SomeClass; // the actual object is on the heap

You cannot create an object using new if the object is on the stack! This should have been:

SomeClass* pO;
pO = new SomeClass;

Vlad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform