Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!s3!robert From: robert@ireq.hydro.qc.ca (R.Meunier 8516) Newsgroups: comp.lang.c++ Subject: new for array of int Message-ID: <7525@s3.ireq.hydro.qc.ca> Date: 18 Jun 91 20:58:54 GMT Sender: usenet@s3.ireq.hydro.qc.ca Reply-To: robert@ireq.hydro.qc.ca () Organization: IREQ, Hydro-Quebec, QC, Canada Lines: 54 I'm looking for a way to allocate an array of integer (or any other type) using the operator new. I thought that the following line would have create an array of 10 element but found out looking at the c code generated that 10 was assigned to the int. maint() { int *i; i = new int(10); } this is the c code after cfront ---------------------------------------------------------------------- /* <> */ /* < int.cc > */ char *__vec_new (); char __vec_delete (); typedef int (*__vptp)(); struct __mptr {short d; short i; __vptp f; }; extern char *__nw__FUi (); int main (){ _main(); { int *__1i ; { int *__0__N1 ; __1i = ( ( (__0__N1 = (((int *)__nw__FUi ( sizeof (int )) ))), (((*__0__N1 ))= 10 )) , __0__N1 ); } } } ---------------------------------------------------------------------- Do i have to create an Int class? PS i couldn't find anything int the ARM! -- Robert Meunier Institut de Recherche d'Hydro-Quebec Ingenieur 1800 Montee Ste-Julie, Varennes Internet: robert@ireq.hydro.qc.ca Qc, Canada, J3X 1S1 maintainer: BASIC mailing list request to basic-request@ireq.hydro.qc.ca