muhammad shahid wrote: > hello friends > what is the diffrence between these codes and which of > them is correct? > Suppose Class functions are ok and executabe > > 1. class_name *object=new int[variable]; > > > > 2. class_name object=new class_name[variable] > > > i am using this to covert a variable(inputed by user) into constant array
Neither is correct. new/delete should not appear at the application layer. Use either smart pointers or Block/vector instead (depending on what you want to do). -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* VerifyMyPC 2.5 Change tracking and management tool. Reduce tech. support times from 2 hours to 5 minutes. http://www.CubicleSoft.com/VerifyMyPC/
