February 06, 2003 another reason to get rid C casts ... '255' is not an lvalue | ||||
---|---|---|---|---|
| ||||
the following code generates the error mc.d(7): '255' is not an lvalue (DMD 0.52 alpha) void func( byte[] buf ) { int i=8; buf[1] = ((buf[i])&0xFF); } int main( char[][] args ) { int i = 8; int[] foo = new byte[16]; func( foo ); return 0; } |
February 15, 2003 Re: another reason to get rid C casts ... '255' is not an lvalue | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mike Wynn | The trouble here is that buf[i] looks like a type. Argh. "Mike Wynn" <mike.wynn@l8night.co.uk> wrote in message news:b1sdkp$r6i$1@digitaldaemon.com... > the following code > generates the error > mc.d(7): '255' is not an lvalue > > (DMD 0.52 alpha) > > void func( byte[] buf ) > { > int i=8; > buf[1] = ((buf[i])&0xFF); > } > > int main( char[][] args ) > { > int i = 8; > int[] foo = new byte[16]; > func( foo ); > return 0; > } > > > |
Copyright © 1999-2021 by the D Language Foundation