hi all,
can someone tell me the best way to delete an object?
i have a car database and need to delete a car which has:
reg no.
make
model
price
thanks to all who respond.
jim
hi all,
can someone tell me the best way to delete an object?
i have a car database and need to delete a car which has:
reg no.
make
model
price
thanks to all who respond.
jim
do you need to delete an object?
maybe u mean a constructor!?
if so use a"~"
else u just write delete and then the stuff u want to delete!
yeah i mean, are there any other way than these two?
delete object;
delete [] object;?
don't forget to set it to NULL afterwards though,
you can't call a destructor within your program, just so you know.
you could dynamically allocate memory for the class then delete it. create a destructor.
This is true. Use a normal function to destroy the object, which can then be called by the destructor instead.Originally posted by Aran Elus
you can't call a destructor within your program, just so you know.
You say you have a database of cars, and you want to delete one. Do you mean delete an object or delete a record from the database?
gcc -lalleg
http://www.ciusa.net/~jrgrant/