Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

有關在 VC++ 的問題

0 views
Skip to first unread message

努力趕程式!!

unread,
Nov 29, 1997, 3:00:00 AM11/29/97
to

在工作站用 g++ compile 沒問題
用 vc++ compile 就會有 error
出問題在這行
int **A = new (int *)[4] ;
error message 如下,有人知如何解決嗎?
error C2143: syntax error : missing ';' before '['


--
Ξ Origin: 中正大學寂寞芳心小站 <bbs.ccu.edu.tw> [FROM: 140.123.101.79]

嵐雲

unread,
Nov 29, 1997, 3:00:00 AM11/29/97
to

==> 在 quit...@bbs.ccu.edu.tw (努力趕程式!!) 的文章中提到:
: 在工作站用 g++ compile 沒問題

: 用 vc++ compile 就會有 error
: 出問題在這行
: int **A = new (int *)[4] ;
: error message 如下,有人知如何解決嗎?
: error C2143: syntax error : missing ';' before '['
不要括號...
int **A= new int* [4];

feng

unread,
Nov 29, 1997, 3:00:00 AM11/29/97
to

=A7V=A4O=BB=B0=B5{=A6=A1!! wrote:
> =

> =A6b=A4u=A7@=AF=B8=A5=CE g++ compile =A8S=B0=DD=C3D
> =A5=CE vc++ compile =B4N=B7|=A6=B3 error
> =A5X=B0=DD=C3D=A6b=B3o=A6=E6
> int **A =3D new (int *)[4] ;
> error message =A6p=A4U,=A6=B3=A4H=AA=BE=A6p=A6=F3=B8=D1=A8M=B6=DC?


> error C2143: syntax error : missing ';' before '['

> =

> =

> --
=A7=EF=A6=A8=B3o=BC=CB=A4l=A6n=A4=A3=A6n:
int **a;
a =3D (int **)new (int *)[4];

-- =

--------------------------------------------------------
=A1=B0=A6=F9=AFq=AC=EC=A7=DE=BA=F4=B8=F4=AAA=B0=C8=A4p=B2=D5 =A1=B0=BA=F4=
=A7}< http://www.techup.com.tw >
--------------------------------------------------------

0 new messages