mano M wrote: > 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
You have 'new' at the application layer. 'new'/'delete' should only appear in the library layer. To initialize dynamically allocated memory without a loop, you can use a class or template and set the value in the constructor. Just realize, though, at some level there will be a loop. Your code might not say 'for' or 'while', but there will be one. -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
