Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Question for the C++ gurus
Message
De
12/05/2000 00:24:35
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00368531
Message ID:
00368941
Vues:
19
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform