编译错误帮助字节数组 [英] Compile error help byte array

查看:49
本文介绍了编译错误帮助字节数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我有以下代码:

背景:

const int MAX_DATA_BYTES = 250;

byte [] blkin = new byte [MAX_DATA_BYTES]; / *接收缓冲区* /


我在下面使用它:

memmove(blkout [1],blkout [0],len);


但我收到以下错误:

无法将[]索引应用于''byte'类型的表达式


我做错了什么?

谢谢

迈克

Hello,
I have the following code:
background:
const int MAX_DATA_BYTES=250;
byte[] blkin =new byte[MAX_DATA_BYTES]; /* Receive buffer */

and I use it in the following:
memmove(blkout[1], blkout[0], len);

but i get the following error:
Cannot apply indexing with [] to an expression of type ''byte''

What am i doing wrong?
Thanks
mike

推荐答案

其实我把memmove改成了ARRAY.COPY。 (对不起,我将交付

程序移植到c#)

AMP写道:
Actually I changed memmove to ARRAY.COPY. (Sorry, Im porting a c
program to c#)
AMP wrote:

你好,

我有以下代码:

背景:

const int MAX_DATA_BYTES = 250;

byte [] blkin = new byte [MAX_DATA_BYTES]; / *接收缓冲区* /


我在下面使用它:

memmove(blkout [1],blkout [0],len);


但我收到以下错误:

无法将[]索引应用于''byte'类型的表达式


我做错了什么?

谢谢

迈克
Hello,
I have the following code:
background:
const int MAX_DATA_BYTES=250;
byte[] blkin =new byte[MAX_DATA_BYTES]; /* Receive buffer */

and I use it in the following:
memmove(blkout[1], blkout[0], len);

but i get the following error:
Cannot apply indexing with [] to an expression of type ''byte''

What am i doing wrong?
Thanks
mike


让我改写这个:

您好,

我有以下代码:

背景:

const int MAX_DATA_BYTES = 250;

byte [] blkout =新字节[MAX_DATA_BYTES]; / *接收缓冲区* /


我在下面使用它:

ARRAY.COPY(blkout [1],blkout [0],len) ;


但是我收到以下错误:

无法将带有[]的索引应用于类型为''byte'的表达式

Let me rewrite this:
Hello,
I have the following code:
background:
const int MAX_DATA_BYTES=250;
byte[] blkout =new byte[MAX_DATA_BYTES]; /* Receive buffer */

and I use it in the following:
ARRAY.COPY(blkout[1], blkout[0], len);

but i get the following error:
Cannot apply indexing with [] to an expression of type ''byte''


Mike,


您正在显示blkin变量的声明,但您的呼叫是

indexer用于blkout变量。我会看一下。


希望这会有所帮助。

-

- Nicholas Paldino [.NET / C# MVP]

- mv*@spam.guard.caspershouse.com


" AMP" < am ****** @ gmail.comwrote in message

news:11 ********************** @ i3g2000cwc .googlegro ups.com ...
Mike,

You are showing the declaration for the blkin variable, but your call on
the indexer is for the blkout variable. I would take a look at that.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"AMP" <am******@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...

你好,

我有以下代码:

背景:

const int MAX_DATA_BYTES = 250;

byte [] blkin = new byte [MAX_DATA_BYTES]; / *接收缓冲区* /


我在下面使用它:

memmove(blkout [1],blkout [0],len);


但我收到以下错误:

无法将[]索引应用于''byte'类型的表达式


我做错了什么?

谢谢

迈克
Hello,
I have the following code:
background:
const int MAX_DATA_BYTES=250;
byte[] blkin =new byte[MAX_DATA_BYTES]; /* Receive buffer */

and I use it in the following:
memmove(blkout[1], blkout[0], len);

but i get the following error:
Cannot apply indexing with [] to an expression of type ''byte''

What am i doing wrong?
Thanks
mike



这篇关于编译错误帮助字节数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆