Re: [Vala] Incompatible operand



On Wed, Nov 2, 2011 at 5:46 AM, Shawn Ferris <shawn ferris gmail com> wrote:

Hey All --

Is there another operand for the following, or is this a bug?

uchar[] foo = new char[100];
int len = 0;
int final_len = 0;

some_method(foo,out len);
some_method2(foo+len, out final_len);

The foo+len yields the error:

x.vala:90.25-90.52: error: Incompatible operand

However, if I replace the variable length with a hardcoded one, it's
accepted:

some_method2(foo+16, out final_len);

Thanks for the help!


Arithmetic is done with pointers: uchar *bar = foo; then bar+16.

-- 
www.debian.org - The Universal Operating System


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]