[EMAIL PROTECTED] wrote: > Hi, > > why don't you use std::vector ? > > std::vector<int> p(10);
That won't initialize the data. It is a better approach than using new/delete but doesn't solve the OP's problem (whatever the actual problem is). > ---------- Initial Header ----------- >>From : [email protected] > To : [email protected] > Cc : > Date : Tue, 7 Aug 2007 08:30:27 -0700 (PDT) > Subject : [c-prog] initialize dynamic array > > Hi > > I like to initialize array of values at the time of creation > > int *p = new int[10]; > > How can I initialize without using loop .Will memset work > with new operator?or any other solution? > Please help me > > Thanks, > Manoj Manoj, it might help if you tell us WHY you need to do this. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
