www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.DMDScript

D - vector operations

↑ ↓ ← Dan <Dan_member pathlink.com> writes:
Please, why the following code:

int main (char[][] args)
{
int[] a;
int[] b;

a.length=5;

a[]=3;

b[] = 2*a[] ;

return 0;
}

produces the compiler error (on line 10):
"
: incompatible types for ((2) * (a[])): 'int' and 'int[]'
: 'a[]' is not an arithmetic type
"
?
Thank you very much for help,
Dan M. Ripa
Sep 06 2004
↑ ↓ → Ilya Minkov <minkov cs.tum.edu> writes:
Whole-vector math has not been implemented yet, and i recall the manual 
states it somewhere, though probably at a surprisingly unrelated spot.

BTW, this newsgroup is dead. If you have any further questions, you may 
want to post them here:

(NNTP server:)
news://news.digitalmars.com/digitalmars.D

(Web interface:)
http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D

You may also want to make yourself comfortable on our Wiki:
http://www.prowiki.org/wiki4d/wiki.cgi?FrontPage
http://www.prowiki.org/wiki4d/wiki.cgi?FaqRoadmap

-eye/PaC


Dan schrieb:

 Please, why the following code:
 
 int main (char[][] args)
 {
 int[] a;
 int[] b;
 
 a.length=5;
 
 a[]=3;
 
 b[] = 2*a[] ;
 
 return 0;
 }
 
 produces the compiler error (on line 10):
 "
 : incompatible types for ((2) * (a[])): 'int' and 'int[]'
 : 'a[]' is not an arithmetic type
 "
 ?
 Thank you very much for help,
 Dan M. Ripa
 
 

Sep 07 2004