www.digitalmars.com         C & C++   DMDScript  

D - vector operations

reply 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
parent 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